Home » date » 2009 » Dec » 06 »

*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, 06 Dec 2009 13:06:51 -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/06/t1260130179lhurq7av1gecypf.htm/, Retrieved Sun, 06 Dec 2009 21:09:46 +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/06/t1260130179lhurq7av1gecypf.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 «
8 8.1 7.7 7.5 7.6 7.8 7.8 7.8 7.5 7.5 7.1 7.5 7.5 7.6 7.7 7.7 7.9 8.1 8.2 8.2 8.2 7.9 7.3 6.9 6.6 6.7 6.9 7 7.1 7.2 7.1 6.9 7 6.8 6.4 6.7 6.6 6.4 6.3 6.2 6.5 6.8 6.8 6.4 6.1 5.8 6.1 7.2 7.3 6.9 6.1 5.8 6.2 7.1 7.7 7.9 7.7 7.4 7.5 8
 
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'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
188000
28.18.099304449198870.09936193272613850.0006955508011307090.308511249714436
37.77.70967023168305-0.379823096535826-0.00967023168305377-1.49769065662826
47.57.4954508121445-0.2184496016235050.004549187855506430.499193671101117
57.67.595752373383740.09229663378910540.00424762661626090.961635756904163
67.87.799986517266570.2014291937076021.34827334256824e-050.337716734691692
77.87.804405785082840.0093581382982604-0.00440578508283849-0.594374418874952
87.87.79989706675575-0.004161079449765050.000102933244253802-0.0418359609874697
97.57.50546242137795-0.287157700128211-0.00546242137795457-0.875748567568387
107.57.49448998041217-0.01789620282582410.005510019587830160.833244474791906
117.17.10808047676384-0.377171139797197-0.0080804767638441-1.11179600188506
127.57.485895703931070.3588882619472460.01410429606892542.27777619810589
137.57.50817152722320.030766744971273-0.00817152722320605-1.01562861635822
147.67.58577584302210.0764431868568890.01422415697789750.141721318024696
157.77.708084902549690.120444402834582-0.008084902549686730.137155056554520
167.77.705033960769090.00224290686069793-0.00503396076908836-0.365535498036017
177.97.89494398479970.1818778379552560.005056015200306150.555922000900198
188.18.095222322883090.1994928643845230.004777677116913320.054510592384948
198.28.211568636725210.119896450216909-0.0115686367252141-0.246315523744929
208.28.19136317121849-0.01422264373837790.00863682878151016-0.415038890572853
218.28.217620936181070.0245291499262838-0.01762093618107020.11991955150004
227.97.88334811969565-0.3189511367191680.0166518803043466-1.06291859284222
237.37.3366405515546-0.536982619866879-0.0366405515545952-0.674710439127613
246.96.87274831376788-0.4670137243020970.02725168623212080.216522756053243
256.66.60322880781594-0.277984677233863-0.003228807815936660.585118113270929
266.76.680778280804920.06248848515555740.01922171919508441.05523538936971
276.96.895538934429750.2067130949940310.004461065570246950.448346259232338
2877.016707986308370.125703228716512-0.0167079863083701-0.250537507528987
297.17.098777097004710.0843970806454650.00122290299528812-0.127832287785298
307.27.193594864226460.09426346627676990.006405135773542810.0305320301909731
317.17.1097016351423-0.0744170650141647-0.00970163514229267-0.521991434909512
326.96.90500525228746-0.197765369007872-0.00500525228745867-0.381708087264946
3376.996834894033540.0764225235792980.003165105966455330.848489486405636
346.86.78486847607902-0.1966240158552560.0151315239209758-0.844957502523326
356.46.43998676398004-0.336995346712752-0.0399867639800414-0.434387071684056
366.76.651503306542550.1823258811300790.04849669345745371.60707073403234
376.66.62560915364917-0.0147828240076449-0.0256091536491688-0.61016753382485
386.46.39911093706961-0.2152853249086930.00088906293038985-0.620897814428474
396.36.28569187521146-0.1194870064512530.01430812478853720.297268925891285
406.26.21185284272088-0.0765268697523408-0.01185284272087870.13289122419191
416.56.491816169881960.2587653209561350.00818383011803811.0376043736334
426.86.787134501511950.2931512568634130.01286549848805420.106409678177342
436.86.806088275997420.0352052074693835-0.00608827599741574-0.798228167377785
446.46.44443838014493-0.338123841981909-0.0444383801449323-1.15528735084653
456.16.08321905330234-0.359850099215210.0167809466976619-0.0672330974337153
465.85.75831892912312-0.3269720003536920.04168107087687860.101743081994066
476.16.147582261202330.346809114373828-0.04758226120233372.08505650834347
487.27.125677002658760.9406481544460280.07432299734123841.83767299461869
497.37.345755389712940.262895392745059-0.0457553897129378-2.09813128064469
506.96.92888049085359-0.37661523213112-0.0288804908535856-1.97945586579179
516.16.09037159746416-0.8092106158748720.00962840253584268-1.34095569420808
525.85.80630513631187-0.316903597736691-0.00630513631186751.52319813244369
536.26.17541031405940.325773629474970.02458968594060471.98873885773683
547.17.064526955465950.8536231628801050.03547304453404641.63348204105457
557.77.699526355700560.6487668777603030.000473644299443214-0.633938179025671
567.97.959281110007140.284256019334568-0.0592811100071382-1.12799918071472
577.77.68073704880277-0.2430934212024120.0192629511972343-1.63191183021578
587.47.38031644492034-0.2968099095679340.0196835550796612-0.166228641584115
597.57.58480114684650.172913430160318-0.08480114684650081.45358846577102
6087.901772118934040.3078893353042790.09822788106596240.417693835744486
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/1z8rs1260130008.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/1z8rs1260130008.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/2fehi1260130008.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/2fehi1260130008.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/35ijw1260130008.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/35ijw1260130008.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/4cnvw1260130008.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/4cnvw1260130008.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/5xs701260130008.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260130179lhurq7av1gecypf/5xs701260130008.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