Home » date » 2009 » Dec » 04 »

*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, 04 Dec 2009 05:25:38 -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/t1259929615orktg1w753iyn6y.htm/, Retrieved Fri, 04 Dec 2009 13:27:02 +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/t1259929615orktg1w753iyn6y.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 «
1,4816 1,4562 1,4268 1,4088 1,4016 1,3650 1,3190 1,3050 1,2785 1,3239 1,3449 1,2732 1,3322 1,4369 1,4975 1,5770 1,5553 1,5557 1,5750 1,5527 1,4748 1,4718 1,4570 1,4684 1,4227 1,3896 1,3622 1,3716 1,3419 1,3511 1,3516 1,3242 1,3074 1,2999 1,3213 1,2881 1,2611 1,2727 1,2811 1,2684 1,2650 1,2770 1,2271 1,2020 1,1938 1,2103 1,1856 1,1786 1,2015 1,2256 1,2292 1,2037 1,2165 1,2694 1,2938 1,3201 1,3014 1,3119 1,3408 1,2991
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
11.48161.4816000
21.45621.4575207999565-0.00132079994551282-0.00132079995650077-0.426435187031089
31.42681.42823266926491-0.00143266926490572-0.00143266926490572-0.826541506682138
41.40881.41029841263809-0.00149841263808581-0.00149841263808581-0.487681100692778
51.40161.40312094855557-0.00152094855557244-0.00152094855557244-0.167835020489262
61.3651.36665905505158-0.00165905505158485-0.00165905505158485-1.03261406592776
71.3191.32083294110301-0.00183294110301073-0.00183294110301073-1.30526443616929
81.3051.30688046867487-0.00188046867486810-0.00188046867486810-0.358164477712999
91.27851.28047626451267-0.00197626451266697-0.00197626451266697-0.724736267722295
101.32391.32569263558796-0.00179263558795749-0.001792635587957491.39464706268916
111.34491.34660463313754-0.00170463313753521-0.001704633137535210.670967231770499
121.27321.27517384607608-0.0019738460760805-0.00197384607608049-2.06053167576784
131.33221.29864567021683-0.003050393617501680.03355432978317090.908524196673319
141.43691.436538363501620.0003616363426051570.0003616364983825013.54372588351020
151.49751.497029038129420.0004709618705824680.0004709618705824581.77511095853184
161.5771.576385869584260.0006141304157435340.0006141304157435282.32884052408926
171.55531.554726220633220.0005737793667789980.000573779366779008-0.657557496272557
181.55571.555126534314380.0005734656856162750.000573465685616264-0.00512097536522936
191.5751.574392792811620.0006072071883756470.000607207188375650.551839259784684
201.55271.552133992823930.000566007176068270.000566007176068271-0.67503770671021
211.47481.474374865366110.0004251346338872820.000425134633887268-2.31226787157924
221.47181.471381003600130.0004189963998686140.00041899639986861-0.100933408217086
231.4571.456608228995790.0003917710042128430.000391771004212837-0.448480952493273
241.46841.467988571444300.0004114285556966870.0004114285556966960.324396484186423
251.42271.434541556349210.00107650511441964-0.0118415563492138-1.10126877603234
261.38961.389243764664410.0003562352840395820.000356235335589112-1.24331648436759
271.36221.361876380741370.0003236192586264180.000323619258626414-0.818185982906271
281.37161.371265727712380.0003342722876238920.0003342722876238830.267549707947931
291.34191.341600937879050.0002990621209530770.000299062120953085-0.885338169794054
301.35111.35079051523520.0003094847647988490.0003094847647988380.262378438573609
311.35161.351290292410370.0003097075896344730.0003097075896344750.00561593900392191
321.32421.323922663563970.0002773364360343750.000277336436034372-0.816817268774445
331.30741.307142590444210.0002574095557898210.000257409555789808-0.503400217378331
341.29991.299651631714050.0002483682859464190.000248368285946414-0.228670573412785
351.32131.321027008161510.0002729918384865110.0002729918384865040.623501827896867
361.28811.287865930244900.0002340697551043130.000234069755104321-0.986708071547363
371.26111.266687461703990.000507951055583273-0.00558746170399208-0.674528374654215
381.27271.272135565136700.0005644347670280540.0005644348633044710.136116288107659
391.28111.280528757616650.000571242383345150.0005712423833451470.231008727017761
401.26841.267840277792380.0005597222076191650.000559722207619156-0.391263915138439
411.2651.264443712070110.0005562879298885350.000556287929888545-0.116740916394658
421.2771.276433795508490.0005662044915139470.0005662044915139330.337384762474245
431.22711.226577489192200.0005225108077975040.000522510807797505-1.48785068199346
441.2021.201499653994030.0005003460059724610.000500346005972458-0.755406213968388
451.19381.193307173739960.0004928262600428490.000492826260042838-0.256504834555903
461.21031.209793350619230.0005066493807712940.0005066493807712910.471925942101908
471.18561.185115099238280.0004849007617196910.000484900761719684-0.743146565720972
481.17861.178121551738960.000478448261037450.000478448261037457-0.220671152371540
491.20151.204102732203990.000236612009283087-0.002602732203988640.790458499377938
501.22561.225174896451230.0004251034324183370.0004251035487708220.582845713590406
511.22921.228772708492280.0004272915077169620.0004272915077169570.0936109569276325
521.20371.203290564753840.0004094352461584020.000409435246158393-0.764459252765785
531.21651.216082037179940.0004179628200643360.0004179628200643460.36533257307745
541.26941.268945942243390.0004540577566093530.0004540577566093271.54741955714384
551.29381.293329484550950.0004705154490472480.0004705154490472520.70604020149205
561.32011.319611744520170.0004882554798332860.0004882554798332830.761576161780302
571.30141.300924914222080.0004750857779232760.000475085777923262-0.565761247670541
581.31191.311418038423500.0004819615765022120.0004819615765022080.295582332635997
591.34081.340298560672490.0005014393275123620.0005014393275123550.837899644406836
601.29911.298627465768220.000472534231777310.000472534231777324-1.24430049621198
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929615orktg1w753iyn6y/1xayz1259929534.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929615orktg1w753iyn6y/1xayz1259929534.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929615orktg1w753iyn6y/3451r1259929534.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929615orktg1w753iyn6y/3451r1259929534.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929615orktg1w753iyn6y/53fxe1259929534.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929615orktg1w753iyn6y/53fxe1259929534.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