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:33:37 -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/t1259930062kzt2l48npo90mfn.htm/, Retrieved Fri, 04 Dec 2009 13:34:29 +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/t1259930062kzt2l48npo90mfn.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 «
89.1 82.6 102.7 91.8 94.1 103.1 93.2 91 94.3 99.4 115.7 116.8 99.8 96 115.9 109.1 117.3 109.8 112.8 110.7 100 113.3 122.4 112.5 104.2 92.5 117.2 109.3 106.1 118.8 105.3 106 102 112.9 116.5 114.8 100.5 85.4 114.6 109.9 100.7 115.5 100.7 99 102.3 108.8 105.9 113.2 95.7 80.9 113.9 98.1 102.8 104.7 95.9 94.6 101.6 103.9 110.3 114.1
 
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
189.189.1000
282.687.67356759367560.070661335083685-4.83289900147734-1.26376710787920
3102.792.53742069550540.4414006454199089.88193886027581.83295820362419
491.893.72322534816210.506741004292658-1.966416808313210.302144510099444
594.194.21271444070750.505352961175474-0.111460861325777-0.00839169356607527
6103.197.03697805693550.6652222989730295.869335689379091.24792503782846
793.296.95595929704360.620482294699894-3.68996230465643-0.416890858348134
89195.2542477415390.492271363529052-4.04539168199824-1.30837928549922
994.394.37995481149230.4186222081562280.0430338458187371-0.768405531047828
1099.495.53010279535380.4585783865886633.804404301791630.409135792443233
11115.7101.8830346237220.79018592766644213.29292052170283.27680620722125
12116.8108.6872126620641.139616866110997.581809179282773.32436051732856
1399.8109.7069111715901.13509570937778-9.8961792436059-0.0685715403112831
1496109.3482576792361.06916975458905-13.2145226927723-0.854500864357059
15115.9108.9075367090240.981867478691657.11765740644708-0.806237121280075
16109.1109.8664663396280.980334259507665-0.764695170559177-0.0116276766541316
17117.3112.9503815034081.12844121438554.189334156149091.06458804620003
18109.8111.0189184677510.912437316831462-0.980416359416592-1.58438149819009
19112.8111.7265622095970.8982532663015591.08980896582434-0.108246170312348
20110.7113.2319412888500.939299781689044-2.581180684874240.324104624605673
21100111.2162347903180.743772586705867-10.9755267988505-1.5798836516807
22113.3112.1680523828200.7572990784028371.115023075304520.110936266216029
23122.4113.0115149049840.762817365769279.381498271310440.0457904039142626
24112.5110.9509205549330.5843923038000811.77759736505148-1.49906264316161
25104.2110.9871141494660.550036454056627-6.74264463237395-0.292175816684771
2692.5109.4240871229790.415680887869005-16.7526296803810-1.12662006499606
27117.2109.3601156173340.3843136436322087.87838008183542-0.253127173094381
28109.3109.7862057662860.387116774161451-0.4895046583716630.0217605597666081
29106.1107.0548523810760.174595490361852-0.710786617790741-1.61595075489152
30118.8109.9444186918960.3606374348507968.642666708311471.41228038032247
31105.3109.1094086541620.278831216841328-3.71495641353411-0.626267073776282
32106108.1716104117050.196038422195312-2.07493289007177-0.640119773120965
33102109.2635215965010.256582016432027-7.334832991741540.471591316201895
34112.9110.0770540495040.2939629988962682.778678470964240.292616067650864
35116.5108.7935435138860.188686083673667.83157294837637-0.827295293706676
36114.8109.3100033691940.2104861722862565.464014283850540.171907489087508
37100.5108.4081061166760.136521188636719-7.81982454891272-0.584310444575924
3885.4106.130776274590-0.0244901443439168-20.5390709669054-1.26870561735737
39114.6105.368748457967-0.07394244343564529.28970419541597-0.386825813918688
40109.9106.193972301926-0.01334443428394743.635059656185230.469928404238995
41100.7105.432198674586-0.0639627952181262-4.67331363913502-0.39031617435152
42115.5105.261801856565-0.071172857144831610.2465704631829-0.0555379637589362
43100.7104.792277590348-0.0981582484897988-4.06087983108222-0.208301318247045
4499103.681141866864-0.166706011980017-4.60113639881148-0.530579051070181
45102.3104.935775751787-0.0706867075696512-2.748101846452310.74460993716873
46108.8105.203826002547-0.04784574588895823.569424544753730.177298497179398
47105.9102.940971897003-0.1969623524044553.13376480298004-1.15838376518282
48113.2103.033898315068-0.17746596038841510.14323944818080.151602761441785
4995.7102.594631830461-0.195070989924486-6.87397399877705-0.137002836868411
5080.9101.949997802972-0.225322449647116-21.0145067820685-0.235361753324581
51113.9102.529918937718-0.17107651645515911.30653352209210.421389309133307
5298.1100.066550888803-0.325670633845515-1.78585664369489-1.19832924639339
53102.8101.272461595013-0.2222974143400181.406937759326320.80002735298177
54104.799.4336801714063-0.3314431033511165.39357434145746-0.844394939938273
5595.998.8169678705694-0.350705345622336-2.89449844264426-0.149108533738204
5694.698.8274489240714-0.326321984914312-4.25591749312420.188901504238435
57101.6100.150748940310-0.2149984278420971.319198457700310.86283759676451
58103.9100.068284042595-0.2060584894090723.82127034741850.0692984642297913
59110.3102.038582435518-0.0593161706062798.089961613153061.13755747034755
60114.1103.0545312072170.013163571438562810.96077116427050.562005063556034
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259930062kzt2l48npo90mfn/1kzss1259930014.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259930062kzt2l48npo90mfn/1kzss1259930014.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259930062kzt2l48npo90mfn/35rwp1259930014.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259930062kzt2l48npo90mfn/35rwp1259930014.ps (open in new window)


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


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