Home » date » 2010 » Dec » 18 »

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: Sat, 18 Dec 2010 20:42: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/18/t12927048463ku3roqo6cojv0f.htm/, Retrieved Sat, 18 Dec 2010 21:40:53 +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/18/t12927048463ku3roqo6cojv0f.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 «
27951 29781 32914 33488 35652 36488 35387 35676 34844 32447 31068 29010 29812 30951 32974 32936 34012 32946 31948 30599 27691 25073 23406 22248 22896 25317 26558 26471 27543 26198 24725 25005 23462 20780 19815 19761 21454 23899 24939 23580 24562 24696 23785 23812 21917 19713 19282 18788 21453 24482 27474 27264 27349 30632 29429 30084 26290 24379 23335 21346 21106 24514 28353 30805 31348 34556 33855 34787 32529 29998 29257 28155 30466 35704 39327 39351 42234 43630 43722 43121 37985 37135 34646 33026 35087 38846 42013 43908 42868 44423 44167 43636 44382 42142 43452 36912 42413 45344 44873 47510 49554 47369 45998 48140 48441 44928 40454 38661 37246 36843 36424 37594 38144 38737 34560 36080 33508 35462 33374 32110 35533 35532 37903 36763 40399 44164 44496 43110 43880 43930 44327
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time9 seconds
R Server'George Udny Yule' @ 72.249.76.132


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
12795127951000
22978129682.2808907494.836038450710698.71910926002250.51836229665984
33291432768.5927317710109.952745875076145.4072682290521.49314800553482
43348833382.2670313682111.910722440966105.7329686318280.251395316546961
53565235508.9611128197120.063512052557143.0388871803421.00551777214031
63648836364.2112291855123.031961438393123.7887708145420.366906790447081
73538735286.7977561584118.205145056431100.202243841615-0.599097013549521
83567635550.4022677571118.787427597167125.5977322428530.0725627643357
93484434741.0712000567115.085404527458102.928799943287-0.463181637887929
103244732368.885179749105.20374120173078.1148202510191-1.24127416544803
113106830976.991195372299.279468579004691.0088046277702-0.747121686018512
122901028939.499082964890.857224998626570.5009170352003-1.06634066888066
132981230226.241509252140.5280262815244-414.2415092520650.718690690273583
143095130918.291991525656.028617236935532.70800847439380.277682339239381
153297432835.776237490962.025594903121138.2237625091470.927954184715646
163293632916.501703420762.057787637148519.49829657933030.00932278959246116
173401233916.823103895463.84148351024295.176896104650.467763200097136
183294632901.389068913561.76834504189444.6109310864618-0.538063041200826
193194831928.237916570059.785230094127719.7620834300432-0.515948985858539
203059930559.476357989857.053511240865739.5236420101598-0.712186748607805
212769127685.910764214351.460937040695.0892357857162-1.46102588532150
222507325083.684883664246.3976557473744-10.6848836641880-1.32296616566363
232340623361.468061102742.89486686383744.531938897319-0.881791801049781
242224822251.990376583341.1956829224418-3.99037658332042-0.574324122196805
252289623120.213502281425.4458543024650-224.2135022814170.451690573017219
262531725278.940659145657.148121324379938.05934085435750.971641505830082
272655826399.786102494860.2238543020195158.2138975051770.529915378754457
282647126494.220821960660.2624444233553-23.22082196061830.0170509271014414
292754327405.06268761661.3464474506505137.9373123840230.423921795119697
302619826194.51605360559.66917270572413.48394639502692-0.633900608277372
312472524733.665043489357.6659459002131-8.66504348929647-0.757814272322515
322500524895.243427721457.8025609245567109.7565722786080.0517890242693413
332346223454.443699738955.83594253739887.55630026111686-0.746888697081925
342078020825.443513601952.2789042354535-45.44351360195-1.33811259145104
351981519735.864737210850.639718774810179.1352627891573-0.569171531258271
361976119757.052319686050.6238614370043.94768031397104-0.0146718322625776
372145421689.102441021628.2399228519063-235.1024410215840.99319748823325
382389923843.337269616250.674634820273355.66273038379620.996934222493038
392493924773.268553323453.1525887745397165.7314466766320.437757322797109
402358023711.464368847152.1469065672969-131.464368847107-0.555642364501479
412456224366.488308500552.7350272111579195.5116914994610.300428788389833
422469624647.078217492452.972538758471448.92178250755270.113545422278442
432378523857.576848263552.0908788412837-72.5768482635257-0.419824893138959
442381223683.960500822551.8553693419524128.039499177493-0.112475219750298
452191721910.216248311949.95260585949366.78375168808923-0.909738403324164
461971319790.802661915747.6256539299926-77.8026619156559-1.08107773620776
471928219183.338640435146.854565979006998.6613595648733-0.326503671533992
481878818840.866610353746.8554931705810-52.8666103537255-0.193917984590527
492145321599.162848203624.2214124404718-146.1628482036431.40610889833399
502448224388.853972424846.334769121244893.14602757518631.31841346638564
512747427166.41580230153.9638164133367307.5841976990191.35896161383151
522726427446.502334473454.1504057658739-182.5023344734040.112684657972148
532734927192.339665297553.9028964930585156.660334702478-0.153629386590793
543063230398.498837593556.6913367178663233.5011624064941.57072476721767
552942929593.330644274655.918298926904-164.330644274645-0.429452906865215
563008429885.191685019156.1291767609185198.8083149808930.117566974594700
572629026371.915475860452.9316217281738-81.9154758604054-1.77858825636033
582437924470.518850482151.0857827839165-91.5188504821072-0.973866412523855
592333523212.790358781749.7684304480313122.209641218336-0.652280140643474
602134621545.594382674350.3704437764581-199.594382674281-0.855219698479139
612110621544.473035941450.68993049794-438.473035941421-0.0264114748618946
622451424419.355259554668.492105850196994.6447404453891.36078341621955
632835327882.354719715677.8674378428548470.6452802844111.68801480066011
643080530819.124803475280.2129512347226-14.12480347518461.42467365438998
653134831339.915377695680.51926354649238.084622304414580.219527011648791
663455634138.133299810282.6420571643498417.8667001897751.35412856207817
673385534089.582477996682.5366727843818-234.582477996617-0.0653685461928826
683478734416.335282198382.732427108663370.6647178016610.121683780352055
693252932613.157814230381.2060269233796-84.1578142302568-0.93968564897635
702999830125.017728062478.9666936058242-127.01772806242-1.28031142489592
712925729037.095289550777.953433829972219.904710449300-0.581506741494442
722815528349.496496085978.3957169730201-194.49649608592-0.381369121001335
733046630966.743775056266.2895789615917-500.7437750562151.29268001433998
743570435566.54989697589.439680665689137.4501030250292.20042294842791
753932738851.193190687298.102107893078475.8068093128481.58811285119202
763935139372.602198707398.462311098805-21.60219870734390.210945071873762
774223442206.5373015617100.18000169289327.46269843832191.36297836136539
784363043182.2672408017100.798766967937447.7327591982690.436241182839662
794372243960.7554822547101.29928472723-238.7554822547350.337656651238612
804312142754.3600606516100.330791053466366.639939348429-0.651555003009512
813798538182.454755586396.7980551280977-197.454755586278-2.3279650212383
823713537176.850055144295.8897594441837-41.8500551441562-0.549326422101257
833464634452.810874557193.7871355597005193.189125442858-1.40517461792608
843302633337.229217041894.6588430202405-311.229217041816-0.602561324746505
853508735768.827980135185.9113120293703-681.827980135111.18369035757649
863884638738.891833704198.0919003115706107.1081662959461.40725563686474
874201341419.5793453686104.912753387668593.4206546313681.28310811028131
884390843956.0789094090107.09307957202-48.07890940904471.21171071519646
894286842984.9407026375106.459270030257-116.940702637490-0.537235227484615
904442343981.477257874107.038038139085441.5227421259860.443470757627863
914416744372.5566931015107.234079852451-205.5566931014690.141519445380485
924363643126.5326652158106.289080321448509.467334784168-0.674242192971694
934438244455.3770897801107.172113946131-73.37708978011680.609137269797436
944214242173.1122404364105.291190388622-31.1122404363553-1.19065244492877
954345243075.6437547926105.796580571879376.3562452074350.397235152210692
963691237649.3109002936110.242939655890-737.31090029361-2.75681604350344
974241342907.164949433394.8993543419254-494.1649494333442.59742205681868
984534445281.75980816102.99775064759362.24019183997871.11666392924856
994487344516.615015337100.778500105986356.384984662992-0.431185016171642
1004751047338.7292248506103.353928343971171.2707751494021.35606617744812
1014955449625.356694267104.591429604146-71.35669426698321.08782717577683
1024736947143.9651084185103.023693284218225.034891581489-1.28841969975429
1034599846178.2970615391102.327034857192-180.297061539144-0.532450785968873
1044814047620.4042418157103.221761452925519.595758184250.667516941337503
1054844148373.4258842606103.67652485826667.57411573939270.323760894201202
1064492845232.5708672791101.228893301080-304.570867279114-1.61674086575119
1074045440011.460289173498.3941335201582442.539710826619-2.65172657964579
1083866139602.691085255898.821925900948-941.69108525583-0.252771362646512
1093724637977.8539511592102.954148551263-731.853951159238-0.867264459380576
1103684336747.903097446198.912995972095295.0969025538642-0.654822958466854
1113642436233.841867885297.4040080170817190.158132114839-0.304382248886342
1123759437489.352105096798.5549844284914104.6478949032510.57707263022763
1133814438058.143269867598.817961226793485.85673013250.234298201469984
1143873738439.674772718898.9796121306475297.3252272811490.140855795547079
1153456035055.119918877296.8183193452674-495.119918877217-1.73556801764712
1163608035590.005652201697.1008794344995489.9943477984360.218255562447603
1173350833438.393253547895.563199031523969.6067464522415-1.12041490746348
1183546235351.440115764396.8761909522797110.5598842356850.905641830767138
1193337433079.998507442695.829560534939294.001492557447-1.17987807895508
1203211032953.18816888496.019367993776-843.188168884005-0.110977418502929
1213553335928.752607570990.4283054349298-395.7526075709131.44571717600499
1223553235435.736700946188.898936035666396.2632990539502-0.287281776231917
1233790337658.671944179293.9389609620354244.3280558207761.05953910091102
1243676336790.519792547792.9424054750085-27.519792547724-0.479375437775329
1254039940156.1857385494.7784017921807242.8142614599881.63066365106764
1264416443508.973370544496.554237379058655.0266294556091.62322339176908
1274449644989.386419784397.3764315853243-493.3864197843220.689460505252176
1284311042675.128951185395.8636349374046434.87104881475-1.20152562878502
1294388043845.555394736196.584642265618534.44460526388350.535399131003783
1304393043689.802058447896.4104914387764240.197941552222-0.125737322721171
1314432743986.739352603296.483073773849340.2606473968220.0998952442065748
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/1v0fi1292704943.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/1v0fi1292704943.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/2v0fi1292704943.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/2v0fi1292704943.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/3osel1292704943.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/3osel1292704943.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/4z1do1292704943.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/4z1do1292704943.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/5z1do1292704943.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927048463ku3roqo6cojv0f/5z1do1292704943.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