Home » date » 2009 » Dec » 04 »

*Unverified author*
R Software Module: /rwasp_structuraltimeseries.wasp (opens new window with default values)
Title produced by software: Structural Time Series Models
Date of computation: Fri, 04 Dec 2009 07:53:13 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf.htm/, Retrieved Fri, 04 Dec 2009 15:55:03 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf.htm/},
    year = {2009},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2009},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
WS9
 
Dataseries X:
» Textbox « » Textfile « » CSV «
106370 109375 116476 123297 114813 117925 126466 131235 120546 123791 129813 133463 122987 125418 130199 133016 121454 122044 128313 131556 120027 123001 130111 132524 123742 124931 133646 136557 127509 128945 137191 139716 129083 131604 139413 143125 133948 137116 144864 149277 138796 143258 150034 154708 144888 148762 156500 161088 152772 158011 163318 169969 162269 165765 170600 174681 166364 170240 176150 182056 172218 177856 182253 188090 176863 183273 187969 194650 183036 189516 193805 200499 188142 193732 197126 205140 191751 196700 199784 207360 196101 200824 205743 212489 200810 203683 207286 210910 194915 217920
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1106370106370000
2109375108922.636126821728.117486074552452.3638731786120.53976180342067
3116476112678.7166501951500.848942173633797.283349805061.84863387241178
4123297117660.8130749532302.655645483205636.186925046683.22371511887175
5114813120021.8444312902313.72369869994-5208.844431289760.0542558685507608
6117925121405.7741768282120.59311952945-3480.77417682802-0.836149363249779
7126466123780.9722720632176.912810189912685.027727936570.220212956480617
8131235125777.0314443162136.472007443015457.96855568442-0.156203119766590
9120546126700.8379547441866.19469106145-6154.83795474398-1.05231160837369
10123791127779.2282492171690.53239716189-3988.22824921662-0.683042197653349
11129813128095.4814427701383.32855828281717.51855723018-1.18980920536799
12133463128154.9516783001086.986111390375308.04832169982-1.14527250110319
13122987128596.102786079942.376065733486-5609.10278607887-0.558698997672846
14125418128877.507761650794.369139382407-3459.50776165024-0.571797086477347
15130199128609.375783647556.4293478142781589.62421635329-0.919108483204108
16133016128067.596183975310.4731687847014948.4038160248-0.94995527225756
17121454127295.03008731167.905321585922-5841.03008731097-0.936817030554
18122044125935.259207793-251.854576985965-3891.25920779303-1.23491973534993
19128313125477.442227980-297.9847079701722835.55777201953-0.178154160893119
20131556125372.959262827-254.6452476017056183.040737173470.167375519863296
21120027125119.388257161-254.404644123481-5092.38825716130.000929198649321629
22123001125741.574038062-58.0699420297922-2740.57403806170.758233468448591
23130111126628.305712260153.5425043407163482.694287740230.817234630321607
24132524126863.120825001171.7455855183995660.87917499950.070299182584383
25123742128166.643478809425.236078248037-4424.643478808560.978964468090956
26124931128657.546233033439.943815450632-3726.546233032960.0568003552385746
27133646129716.030049186578.4817280219243929.96995081360.535024660628051
28136557130981.492049868732.34860014755575.507950131530.594224113316412
29127509132029.793728439803.114405912926-4520.793728439210.273293054024037
30128945133045.084457054850.636742530929-4100.08445705370.183528248297534
31137191133856.146766401841.7730318283173334.85323359930-0.0342310880615040
32139716134538.370247873806.0378122428025177.62975212698-0.138007149170096
33129083134579.516085602634.720609314018-5496.51608560233-0.661616159639324
34131604135250.151089242642.764560341107-3646.151089241780.0310652280783169
35139413135871.754021700638.0248702645253541.24597829978-0.0183043820992696
36143125136962.93580267739.5209992502876162.064197329950.391971604920762
37133948138585.198768345937.233734896174-4637.198768345190.763554029794596
38137116140299.4529875771111.26742929422-3183.452987576690.67210707613579
39144864141728.8127373711182.512374329083135.187262629340.275143453461322
40149277143362.0667958231283.467551304755914.933204176950.38988248252316
41138796144419.0442670701232.739280721-5623.04426707025-0.195909359595220
42143258146080.7348964321328.81395240476-2822.734896431500.371034281007554
43150034147360.7015891901317.873354017392673.29841081021-0.0422518962105180
44154708148703.6295406511323.484974615556004.37045934850.0216717223949620
45144888150351.8499350641396.2178123606-5463.849935063960.280889600612782
46148762151732.4546269431392.72085302249-2970.45462694307-0.0135050348961255
47156500153473.4622772171470.728626640353026.537722783320.301261067978768
48161088155158.6803604361518.769049373255929.319639563970.185529061879942
49152772157450.0744486381691.81827086577-4678.074448637790.668305104246513
50158011160234.8644666871936.61736545650-2223.864466686600.94539855781426
51163318161681.3377098571826.837000443431636.66229014347-0.423964798289767
52169969163940.2800215841923.618083067736028.719978416130.373762395198737
53162269166666.2368136412103.32244415666-4397.23681364130.694006830745987
54165765168504.4288929832043.93968936677-2739.42889298285-0.229332428011046
55170600169965.3715098081913.36252131543634.628490192199-0.504280730962624
56174681170485.2054395251601.246001937174195.794560475-1.20537417748022
57166364171081.2789723081376.11181069139-4717.27897230773-0.86945394987783
58170240172206.2019269851319.85161487017-1966.20192698485-0.217273303566137
59176150173924.2139495741409.029864502652225.786050425810.34440073698758
60182056176275.3702261491620.043271994345780.629773851190.814920379732723
61172218177635.2474600991561.77240568825-5417.24746009915-0.225038385294920
62177856179611.3570594471654.57386201560-1755.357059447350.358393331158385
63182253181006.8444770671596.544798435221246.15552293290-0.224104558523441
64188090182391.6901470191549.129341345955698.30985298091-0.183115484251453
65176863183230.7864490231390.09920574695-6367.78644902319-0.614164284780776
66183273184571.5814645301379.05626601723-1298.58146452955-0.0426471319755319
67187969186167.2634160921427.575152093841801.736583908190.187376856929387
68194650188066.8658435531533.297783927486583.13415644720.408294090429373
69183036189618.2410378391537.34668427623-6582.241037838940.0156365960292397
70189516191104.7787606751525.96671238795-1588.77876067512-0.0439487287693232
71193805192458.1107022521487.300721525461346.88929774847-0.149325601301638
72200499193896.0049629661476.234875674736602.9950370343-0.0427355939603103
73188142195042.3332267211402.34381663732-6900.33322672124-0.285362577693019
74193732195824.1522191801263.36134474689-2092.15221918033-0.536741480626576
75197126196328.1662397531093.28600847501797.833760247265-0.656820148375207
76205140197623.4700453211138.533082744867516.529954679060.174741327501807
77191751198528.1375874461086.15288833711-6777.13758744632-0.202288984499335
78196700199026.400332053954.479791319815-2326.40033205313-0.508513139034264
79199784199440.804816082833.516054995908343.195183918381-0.467154268113753
80207360199855.138482433739.6293928081287504.86151756699-0.362584327277488
81196101201334.646858300905.344294063595-5233.646858299720.63998042524287
82200824202628.090447718992.269099173051-1804.090447717600.33569807734033
83205743204464.3958894861181.312716267071278.604110513850.730074444366178
84212489205745.3870064011203.638254225136743.612993599020.086219809853726
85200810206739.7271550241156.76056787782-5929.72715502414-0.181038647796096
86203683206991.917888325954.158920516609-3308.91788832492-0.78243469628147
87207286206893.445084279718.395010082095392.5549157207-0.910505250364885
88210910205709.952628957292.4184642615335200.04737104314-1.64509436913863
89194915202968.420047704-387.112796165675-8053.4200477037-2.62430657544552
90217920209875.6184601441246.635545575068044.381539856126.30943234775982
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/1d7u01259938389.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/1d7u01259938389.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/2zo061259938389.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/2zo061259938389.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/3udl41259938389.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/3udl41259938389.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/4ylea1259938389.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/4ylea1259938389.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/5metg1259938389.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259938496lnitr6p6ur7nxsf/5metg1259938389.ps (open in new window)


 
Parameters (Session):
par1 = 4 ;
 
Parameters (R input):
par1 = 4 ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1)
nx <- length(x)
x <- ts(x,frequency=par1)
m <- StructTS(x,type='BSM')
m$coef
m$fitted
m$resid
mylevel <- as.numeric(m$fitted[,'level'])
myslope <- as.numeric(m$fitted[,'slope'])
myseas <- as.numeric(m$fitted[,'sea'])
myresid <- as.numeric(m$resid)
myfit <- mylevel+myseas
mylagmax <- nx/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(mylevel,na.action=na.pass,lag.max = mylagmax,main='Level')
acf(myseas,na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(myresid,na.action=na.pass,lag.max = mylagmax,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(mylevel,main='Level')
spectrum(myseas,main='Seasonal')
spectrum(myresid,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(mylevel,main='Level')
cpgram(myseas,main='Seasonal')
cpgram(myresid,main='Standardized Residals')
par(op)
dev.off()
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time',type='b')
grid()
dev.off()
bitmap(file='test5.png')
op <- par(mfrow = c(2,2))
hist(m$resid,main='Residual Histogram')
plot(density(m$resid),main='Residual Kernel Density')
qqnorm(m$resid,main='Residual Normal QQ Plot')
qqline(m$resid)
plot(m$resid^2, myfit^2,main='Sq.Resid vs. Sq.Fit',xlab='Squared residuals',ylab='Squared Fit')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Structural Time Series Model',6,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Observed',header=TRUE)
a<-table.element(a,'Level',header=TRUE)
a<-table.element(a,'Slope',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Stand. Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,mylevel[i])
a<-table.element(a,myslope[i])
a<-table.element(a,myseas[i])
a<-table.element(a,myresid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by