Home » date » 2009 » Dec » 11 »

Structurele tijdreeksanalyse

*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: Fri, 11 Dec 2009 09:46:43 -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/11/t12605500550x7n45ehtwr4sxv.htm/, Retrieved Fri, 11 Dec 2009 17:47:42 +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/11/t12605500550x7n45ehtwr4sxv.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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
21790 13253 37702 30364 32609 30212 29965 28352 25814 22414 20506 28806 22228 13971 36845 35338 35022 34777 26887 23970 22780 17351 21382 24561 17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 20366 22782 19169 13807 29743 25591 29096 26482 22405 27044 17970 18730 19684 19785 18479 10698 31956 29506 34506 27165 26736 23691 18157 17328 18205 20995 17382 9367 31124 26551 30651 25859 25100 25778 20418 18688 20424 24776 19814 12738 31566 30111 30019 31934 25826 26835 20205 17789 20520 22518 15572 11509 25447 24090 27786 26195 20516 22759 19028 16971 20036 22485 18730
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
12179021790000
21325316782.0114077606-165.320321010184-3529.01140776059-2.26734767863568
33770226911.8763596083468.74579168207310790.12364039174.27606069384698
43036430168.7922406593608.2687788764195.2077593406761.44324779072417
53260931906.5316027653645.157679236632702.4683972346870.63266784796825
63021231465.4049342018620.787707839629-1253.40493420176-0.616458413578782
72996530579.712738655592.070794724581-614.712738654988-0.854610744421069
82835229248.6533423686555.108047662618-896.653342368599-1.08852210288513
92581427252.6477771988502.843553614259-1438.64777719885-1.44067065128127
102241424446.6652373676430.834665193079-2032.66523736755-1.86514224430075
112050621849.7389044958361.89866352914-1343.73890449580-1.70434520692938
122880624302.8332279123411.140986843864503.166772087711.17581738932498
132222824666.4229159156411.533990067027-2438.42291591556-0.0282965123289481
141397124946.9463741207410.289837945775-10975.9463741207-0.0755324873357491
153684526511.1505446717445.28984877465110333.84945532830.604504365640298
163533831255.0317442735607.0022371520844082.968255726472.24916974197867
173502233507.9593533594666.3695361859561514.040646640570.893284976457974
183477734896.7523608181689.343293327965-119.7523608181070.400517144106472
192688731547.2459902054574.325083202697-4660.24599020544-2.25266536147311
202397027194.7718877859441.539407229076-3224.77188778588-2.74896329674017
212278024038.0762562432345.798544382081-1258.07625624319-2.00565925250955
221735120729.7051080583249.381958069965-3378.70510805833-2.03359957169916
232138221304.0321768907257.59023928152877.96782310926920.180470581924121
242456120829.8194621869240.9076815735423731.18053781309-0.406659301200053
251740920556.4293561632230.406179221784-3147.42935616318-0.288175435609355
261151422273.5229302763265.773875263281-10759.52293027630.825924042267007
273151423625.2721068701298.203637253747888.72789312990.587520559278356
282707124244.8497084409309.1501674148042826.150291559050.172075723863048
292946225935.5767815616357.8082377596173526.423218438420.74731076676027
302610525058.4377071194315.3930625403001046.56229288060-0.676774364516379
312239724291.7038063260279.860066758035-1894.70380632604-0.59706286157529
322384324250.2404382649269.732815404575-407.240438264899-0.177555021380481
332170522861.8526829586219.106985126509-1156.85268295864-0.915340723717031
341808922005.0681577616187.183354126352-3916.06815776161-0.592880805070453
352076421092.8879879925155.545879723834-328.887987992530-0.605129764388368
362531621210.6858014194154.4867205721974105.31419858057-0.0207986420450988
371770421612.1925549599161.44111919123-3908.192554959870.136298891319140
381554824169.5626797954232.392313342376-8621.562679795411.31595066305880
392802923158.9320543618192.8089759346444870.0679456382-0.675832708728983
402938324766.2020940842240.5204709755454616.797905915760.764554290495505
413643828396.9118306107357.9696750957238041.088169389271.83787375149022
423203430018.5170442967401.7116370860972015.482955703260.689705814735088
432267927769.7340004157311.536742031810-5090.73400041566-1.45371715848061
442431925547.7387666425227.335784319607-1228.73876664249-1.39140083897436
451800422002.6966716285104.864255608299-3998.69667162854-2.0697242032153
461753720840.186338419664.5679136959275-3303.18633841956-0.694333799993492
472036620629.055283217855.9413141495487-263.055283217788-0.150972796997400
482278219987.161265800634.25310126633772794.83873419944-0.382461679549528
491916921763.296551049488.8056818406522-2594.296551049410.95508534471904
501380722409.1691002053106.649321952972-8602.16910020530.304697240747639
512974324431.3997630543169.8506694496875311.60023694571.04281685593041
522559124259.3518963021158.2764730928731331.64810369790-0.185544761497289
532909622823.3828440867103.5038125787206272.61715591333-0.865997119179112
542648222299.35570291681.88815609933544182.64429708401-0.342069280502289
552240523485.6851413292119.671935376913-1080.685141329250.603831570327107
562704424783.5309515849159.4929831351752260.469048415060.644709779288494
571797023466.3046285580110.255247996363-5496.30462855803-0.807450216558366
581873022529.829289945375.7760925707749-3799.82928994532-0.571744375546515
591968421289.048094455732.7680463672691-1605.04809445574-0.718994028150559
601978519730.4384554254-19.092714572777654.5615445745773-0.869645173620562
611847920349.56955685481.80210460583783-1870.569556854820.348875884273631
621069820393.83519501963.2071638753833-9695.835195019580.0231831409142943
633195622905.961935099187.33993405017929050.038064900941.36647043641809
642950625333.6178739727166.7640488838254172.382126027321.27246837224126
653450627112.1284994249221.8764596995297393.871500575080.876611118306704
662716526022.3732822905176.9353599653851142.62671770947-0.714680514769865
672673626756.2216931093195.963179008202-20.22169310930770.303971612882616
682369124080.180342300098.424716454647-389.180342300051-1.56840997958186
691815722965.566185035757.5233280786201-4808.56618503566-0.66209476748381
701732821501.27125648486.54453001870966-4173.27125648483-0.830064388417503
711820520177.9504302087-37.8112855047210-1972.95043020872-0.725298173047532
722099520534.4289275736-24.6751159149381460.5710724264430.215139830485038
731738220408.3723493729-28.0606344716724-3026.37234937288-0.0553314247773259
74936720705.0161893101-17.1623064085986-11338.01618931010.177107006605041
753112422082.411317841029.9396327425849041.588682159030.759690192180759
762655122747.509811930851.51547739938653803.490188069250.34567602660719
773065122733.113730001449.26806502401937917.88626999855-0.0358749166668256
782585923403.551338343170.47372191003252455.448661656910.338418764805274
792510023406.352992332368.16632918608621693.64700766773-0.0369038954257227
802577824137.59792121190.7089149009561640.402078789000.361709001386356
812041824275.093770970892.293708354979-3857.093770970790.0255137879477471
821868823408.581098835659.9261180321608-4720.58109883559-0.522630786906418
832042422929.184246670141.7605583512744-2505.18424667006-0.293960121175542
842477623539.237063791960.89019279993631236.762936208120.309840349049108
851981423621.911597691761.6243029037183-3807.911597691730.0118794079694977
861273824274.244371043281.5790374350345-11536.24437104320.32203121619518
873156623823.302776649563.5356665062827742.69722335047-0.290115104391078
883011124911.968409613498.36634423883235199.031590386630.558187231687873
893001924079.892555096966.69367339079885939.10744490307-0.50663874979335
903193426377.2153845575142.6748543839445556.784615442481.21522178498963
912582625996.8232875808124.867356335637-170.823287580829-0.285113599356204
922683525493.0968094918103.4975899114731341.90319050820-0.342693097889760
932020524529.742255685167.294914418153-4324.7422556851-0.58150420513866
941778923420.279878541427.4312330625485-5631.27987854137-0.641241567556556
952052023224.129847695519.8660449640321-2704.12984769552-0.121829707152954
962251822407.3725771512-8.4325479882688110.627422848849-0.455958790442339
971557221044.7337684367-54.2616558593258-5472.73376843668-0.738143414210378
981150921634.8926661461-32.4277657096451-10125.89266614610.351211262130246
992544720244.1884425091-78.51509000059775202.81155749087-0.740000643476599
1002409019343.5798352467-106.4469640694984746.42016475328-0.447747539831284
1012778620731.3779957187-55.63060134351847054.622004281310.813823875322725
1022619520694.3464035668-54.99786751959075500.653596433220.0101324487018021
1032051620340.7443853140-65.15389050028175.255614686033-0.162723090975126
1042275920319.2892142326-63.66863921170742439.710785767420.0238157550586854
1051902821279.336462866-28.9054900090588-2251.336462866010.557858870656898
1061697121841.5915029133-8.8482937623565-4870.591502913260.32209348583469
1072003621985.3180644959-3.67475375641031-1949.318064495920.0831280155650217
1082248521849.5716449912-8.15219837762342635.428355008787-0.0719648300339925
1091873022857.329543140426.2967327623451-4127.329543140410.55361337869644
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/1wocb1260550001.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/1wocb1260550001.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/2dm801260550001.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/2dm801260550001.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/36bnw1260550001.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/36bnw1260550001.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/4e1wl1260550001.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/4e1wl1260550001.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/5cyq11260550001.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t12605500550x7n45ehtwr4sxv/5cyq11260550001.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
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