Home » date » 2009 » Dec » 18 »

*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, 18 Dec 2009 02:46:34 -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/18/t126112961723uzdn33cugcm81.htm/, Retrieved Fri, 18 Dec 2009 10:47:07 +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/18/t126112961723uzdn33cugcm81.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 «
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
 
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
12036620366000
22278221192.8451924941958.1802919585921589.154807505870.988967204645153
31916920924.5075597769237.625787910858-1755.50755977685-0.433375364748934
41380716728.1081653659-2217.32226812177-2921.1081653659-1.7247754410732
52974323289.72347753582906.129688943336453.276522464223.30016680842751
62559127163.60339297353456.1972338822-1572.603392973480.340923758438181
72909629875.25946326043038.61256038465-779.259463260393-0.262471663803087
82648228864.1054217508757.880330871136-2382.10542175076-1.43811313382639
92240524645.2781362471-2053.83036759147-2240.27813624709-1.76855917728509
102704424815.4945042030-796.7060781286162228.505495796950.79036270804015
111797020595.2929229606-2731.40230129571-2625.29292296061-1.21659674231775
121873018041.7774424149-2630.90634946330688.2225575851480.0631944230686166
131968417940.7657967778-1209.66563505441743.234203222190.898094254258725
141978516975.8805688021-1071.412983905652809.119431197940.088424326657573
151847917684.1298134932-79.2062242131777794.870186506840.618855614954735
161069817854.516197236256.30386771606-7156.516197236210.085437351820229
173195623169.61100413152934.103629115878786.388995868541.84118317930649
182950629556.17996801294836.07240260554-50.17996801292341.19792108688685
193450634022.20560168014633.8536221962483.794398319929-0.126525407088543
202716531726.9232165526863.18658177475-4561.92321655261-2.36958844976569
212673629995.5918444113-551.226994155067-3259.59184441131-0.890169520138849
222369123177.6396485601-3973.12433948536513.360351439931-2.15211394615063
231815719625.1733051999-3743.46334955044-1468.173305199930.144432763473818
241732816921.7516658738-3176.10878602574406.2483341262260.357106617504284
251820515389.4376130231-2278.778281655362815.562386976940.565959870835344
262099516663.2333219120-336.7066855525474331.766678088031.22336394634789
271738217277.2672774953180.429617990396104.7327225046810.324164237801773
28936719048.07432408181038.98436277583-9681.074324081750.539795864984487
293112423112.42784555292674.047322612118011.572154447081.03437660202425
302655126436.67035758283027.02458887888114.329642417190.222722004728340
313065127994.97396954982230.624765963332656.0260304502-0.499948109818415
322585928999.38234319911568.08966123052-3140.38234319911-0.415776007046794
332510027138.7314052673-282.324749683393-2038.73140526729-1.16318783698822
342577825488.7724371708-1020.78188437583289.227562829242-0.464583200189152
352041822910.08623837-1862.35774838318-2492.08623837002-0.529670212222713
361868819653.3180983905-2616.00549608923-965.318098390518-0.47458871454281
372042418146.3097939701-2016.046421087202277.690206029940.377787345280847
382477619263.4623917253-321.4053710292875512.537608274671.06524751903637
391981420470.3820088242502.626193894056-656.3820088242070.517191853013738
401273823113.53524350851652.88333387154-10375.53524350850.72330051130369
413156624521.74894402241521.348242396967044.25105597757-0.0829657380246594
423011128219.11299170462694.195820320181891.887008295420.739481438473368
433001928457.00396066621369.862273482651561.99603933382-0.832589600462527
443193431873.74459101482471.0145754431360.25540898516080.691281070924243
452582629872.056093133869.7103544923293-4046.05609313384-1.50860829147536
462683526574.9018829367-1736.9555322795260.098117063315-1.13655258581735
472020522654.2773848609-2909.39880887272-2449.27738486092-0.738252364671326
481778919331.4099970327-3131.6273352766-1542.40999703273-0.139956573977509
492052018392.7960406685-1952.095478092412127.203959331480.742239425622086
502251817551.7016378320-1354.973748080544966.298362168040.375189097242518
511557216924.7903523204-964.574603769477-1352.790352320430.24515725933423
521150919977.3744569321185.26905455739-8468.374456932021.35197119230072
532544720501.2522577965831.2003181623054945.74774220348-0.223095983629654
542409021503.6858491850923.0259879830842586.314150814970.057859544180473
552778625315.72630846332473.138749238272470.273691536670.974953278542742
562619525492.24651066881242.65898510451702.75348933124-0.772802277934032
572051623839.2608111191-305.713893246069-3323.26081111909-0.972674190162594
582275921787.9361281382-1238.29266853464971.063871861812-0.586591924232752
591902820894.1820914719-1054.13716245344-1866.182091471880.115960509178643
601697119616.5935575569-1173.70450066586-2645.59355755693-0.075295778914886
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/1is0r1261129592.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/1is0r1261129592.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/2o1ed1261129592.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/2o1ed1261129592.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/3n8uh1261129592.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/3n8uh1261129592.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/48t8d1261129592.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/48t8d1261129592.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/5aj011261129592.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/18/t126112961723uzdn33cugcm81/5aj011261129592.ps (open in new window)


 
Parameters (Session):
par1 = FALSE ; par2 = 0.5 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
Parameters (R input):
par1 = 12 ; par2 = 0.5 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
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