Home » date » 2010 » Dec » 19 »

paper - structural time series model

*The author of this computation has been verified*
R Software Module: /rwasp_structuraltimeseries.wasp (opens new window with default values)
Title produced by software: Structural Time Series Models
Date of computation: Sun, 19 Dec 2010 21:11:32 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy.htm/, Retrieved Sun, 19 Dec 2010 22:09:39 +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/2010/Dec/19/t1292792979nx3xtbp7j56x3oy.htm/},
    year = {2010},
}
@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 = {2010},
    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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
631923 654294 671833 586840 600969 625568 558110 630577 628654 603184 656255 600730 670326 678423 641502 625311 628177 589767 582471 636248 599885 621694 637406 595994 696308 674201 648861 649605 672392 598396 613177 638104 615632 634465 638686 604243 706669 677185 644328 644825 605707 600136 612166 599659 634210 618234 613576 627200 668973 651479 619661 644260 579936 601752 595376 588902 634341 594305 606200 610926 633685 639696 659451 593248 606677 599434 569578 629873 613438 604172 658328 612633 707372 739770 777535 685030 730234 714154 630872 719492 677023 679272 718317 645672
 
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'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1631923631923000
2654294640883.06209129758.236910428133813410.93790870280.870101942620719
3671833659978.1098001451361.1634801545211854.89019985491.21250700863849
4586840634514.944964641-500.422008212281-47674.9449646414-2.06794140946806
5600969615912.806174712-1507.09675081473-14943.8061747120-1.61590972933664
6625568614032.110328952-1522.8938397732311535.8896710478-0.0350286263330579
7558110593140.118042973-2196.54109594810-35030.1180429727-1.83345160349387
8630577600218.095509561-1896.4082322507630358.90449043860.876904923948176
9628654612833.326872307-1419.6541792035215820.6731276931.36704279366699
10603184613302.812440088-1354.47643963656-10118.81244008810.17724256864487
11656255629335.124976381-722.95566866118726919.8750236191.62531662340823
12600730623976.689489094-898.763630233703-23246.6894890941-0.432013364168491
13670326639766.057131666-676.8393055059130559.94286833441.61502314486249
14678423652569.587276565-383.26497325543425853.41272343521.30365350864099
15641502638828.94453781-910.9770300902242673.0554621898-1.18800328403872
16625311642600.004479112-678.008841708379-17289.00447911180.400545870968206
17628177641561.528828103-696.890328298752-13384.5288281033-0.031438274222113
18589767614784.422819683-2021.64719606864-25017.4228196831-2.34086191678930
19582471611504.661769796-2082.10455276308-29033.6617697958-0.114695932407457
20636248611732.1246212-1976.2795632113924515.87537880020.211486581305645
21599885603219.619405101-2266.65430323451-3334.61940510131-0.59813091010527
22621694614623.48779648-1672.298894496667070.512203519461.24786334093369
23637406616987.836751044-1500.9547684269620418.16324895570.367482251401571
24595994622886.86410331-1196.36363002908-26892.86410330970.673558445304402
25696308641217.827556756-409.15144032676755090.17244324441.78546658756512
26674201645593.018798181-208.10665932835528607.98120181930.436190753169657
27648861646673.46291519-149.5151542376072187.537084809350.115487101598923
28649605651115.38717206373.6356992150639-1510.387172062880.405359894879599
29672392658705.612795099451.84187379784913686.38720490130.663448207717381
30598396647540.416134674-136.376908711277-49144.4161346743-1.03514024494336
31613177642845.965516264-364.573718091083-29668.9655162635-0.409772769477338
32638104631122.810722943-922.6937939678016981.18927705703-1.02491277267480
33615632627398.254799479-1057.70393999742-11766.2547994786-0.252663517048866
34634465628705.934932766-945.6886397013685759.065067233560.212830168187981
35638686629064.586186385-884.7548830404229621.413813615050.117200892547003
36604243634757.635713912-579.721107644485-30514.63571391190.591475406587797
37706669643652.432019186-139.27814961930563016.5679808140.853208501470973
38677185648679.291097883104.23928076797928505.70890211690.464575850538986
39644328648892.72865147109.494283464402-4564.728651469910.00976606787537028
40644825647998.75148412160.2461510778955-3173.75148412108-0.0892435527487273
41605707623470.038716112-1162.24306819031-17763.0387161125-2.18418612630771
42600136623722.307009521-1091.58436184098-23586.30700952070.126046992046446
43612166627326.217790693-857.529488392752-15160.21779069300.420115755286465
44599659615204.862783674-1415.38514912309-15545.8627836745-1.00981635293772
45634210623942.648201374-916.6430031003310267.35179862610.909835632680837
46618234623444.698711904-896.236432828956-5210.698711903650.0374660322799234
47613576618805.939516748-1077.58634313920-5229.93951674795-0.33465379495846
48627200634100.435369126-286.263036729866-6900.435369126221.46480556962559
49668973628443.897159596-546.17530197930340529.1028404044-0.480894980906667
50651479623354.973172588-767.08740983159928124.0268274116-0.40663516065264
51619661618999.796259778-942.731535817732661.203740222094-0.320527918171830
52644260622417.093826395-727.93421379234221842.90617360540.388602015865585
53579936614513.71939009-1083.03905441044-34577.7193900896-0.639061663788828
54601752616261.939298102-942.642134663424-14509.93929810170.252440870918791
55595376612928.064436625-1061.17298057994-17552.0644366253-0.213580132561553
56588902611090.277900632-1099.58663658828-22188.2779006318-0.0694320211974531
57634341615330.576849084-836.26034930976819010.42315091560.477291551879027
58594305611087.765390418-1003.73516018141-16782.7653904183-0.304250945416232
59606200612625.154828568-879.09570662298-6425.154828568350.226867224660252
60610926612657.090778234-834.457077326572-1731.090778233570.0813595344391838
61633685603860.030821139-1224.7656505000129824.9691788613-0.711457012875998
62639696603325.816925762-1190.8620632613736370.1830742380.0616988781373
63659451623230.911064274-152.82190297913136220.08893572611.88341178023161
64593248607873.731136836-902.584965229595-14625.7311368359-1.35611478462462
65606677615999.027148109-456.691372031727-9322.027148109150.804901898249653
66599434616764.572552914-396.278248457424-17330.57255291430.109015191011130
67569578606281.191305703-894.83769554158-36703.1913057029-0.900368895268242
68629873620833.575068544-131.8872858943749039.424931456311.37941871954421
69613438614338.930607315-445.812222951469-900.930607314856-0.568126196628523
70604172615175.838488607-382.596999868743-11003.83848860720.114489417799578
71658328632863.960163857507.17444887478925464.03983614351.61255848633700
72612633629803.512044694331.587252923908-17170.5120446942-0.318402246551426
73707372648341.6369542041227.7388723344559030.36304579611.62532545834494
74739770676908.8592501452574.1411493833162861.14074985482.44076317665922
75777535705621.2264277233862.3622888741271913.7735722772.33284513117330
76685030713590.9709738544064.94628645068-28560.9709738540.366433897033389
77730234725782.2341812054465.975925292144451.76581879460.724831097502048
78714154731550.6756252434530.26998841336-17396.67562524260.116190612821167
79630872714411.4638244073460.59167283762-83539.4638244069-1.93370364379114
80719492709482.8145254343046.5649726374210009.185474566-0.748775965965379
81677023700884.0047635482472.0539927036-23861.0047635481-1.03935548644910
82679272701342.730766352372.76924759284-22070.7307663498-0.179657977998248
83718317702770.2978779562326.1734308641915546.7021220443-0.0843348829274145
84645672698664.0877846442009.13167833348-52992.0877846438-0.573953825960433
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/1ne2s1292793087.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/1ne2s1292793087.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/2g51d1292793087.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/2g51d1292793087.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/3g51d1292793087.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/3g51d1292793087.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/49wig1292793087.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/49wig1292793087.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/51nhj1292793087.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292792979nx3xtbp7j56x3oy/51nhj1292793087.ps (open in new window)


 
Parameters (Session):
par1 = 12 ;
 
Parameters (R input):
par1 = 12 ;
 
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