Home » date » 2009 » Dec » 03 »

*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: Thu, 03 Dec 2009 11:24:15 -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/03/t1259864807l40oh1x97ipc41m.htm/, Retrieved Thu, 03 Dec 2009 19:26:54 +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/03/t1259864807l40oh1x97ipc41m.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.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 8.1 8
 
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
18.18.1000
27.77.70255673257361-0.397654567698998-0.00255673257360823-1.23520546066601
37.57.49489669492155-0.2111740787412860.005103305078452880.582804441865597
47.67.595696455606710.09341601431732360.004303544393293100.942920929924098
57.87.79938252427580.2011210083670810.0006174757242067750.333533634956366
67.87.803465929480660.00865740305028759-0.00346592948065967-0.596001298891416
77.87.79928988768668-0.003878002934147250.0007101123133146-0.0388183381561296
87.57.50446420003691-0.288068718009973-0.00446420003691253-0.880052173394744
97.57.49427947229257-0.01663819059797730.005720527707431570.840537754486445
107.17.10690986218564-0.378759894815383-0.00690986218564131-1.12138073420551
117.57.486306851966820.361789854606670.01369314803317522.29325724487263
127.57.508356990086410.0299401183446609-0.00835699008640986-1.02763766038116
137.67.597897153891640.08814746178665070.002102846108358770.180289630740346
147.77.701555883064650.103302538349973-0.001555883064649190.0470458683674718
157.77.703294116031760.00558305067796482-0.00329411603175623-0.304688822394776
167.97.895264147816550.1844904407027310.004735852183454670.553686999538775
178.18.095239377235540.199355412593050.004760622764456960.046034554943113
188.28.21044875057380.118569235237501-0.0104487505738044-0.2501699501135
198.28.19142007994629-0.0135331867334410.00857992005370687-0.409081071479970
208.28.216203597292540.0232530085837302-0.01620359729253660.113915653261319
217.97.88396454635163-0.3180396957562770.0160354536483722-1.05687965998974
227.37.33390409274867-0.540792910621740-0.0339040927486718-0.689798930240939
236.96.87381767498871-0.4633098148824010.02618232501128940.239941586523382
246.66.60463692943745-0.276935581305291-0.004636929437446130.57714468085457
256.76.690910334486570.07171186837333750.009089665513431841.07992154152149
266.96.891131573585930.1951292190648330.00886842641407570.382752681603925
2777.013863558781970.126330843643383-0.0138635587819723-0.213991760031918
287.17.098845366395620.08705080921757720.00115463360437555-0.121568169407592
297.27.193943450574230.09469323456823540.006056549425774480.0236676906645659
307.17.1089902381741-0.0759408952527884-0.00899023817409676-0.52840113790303
316.96.90412059679866-0.198401705913208-0.00412059679866323-0.379224050060212
3276.997053729035450.07831495852428460.002946270964552270.856907296032036
336.86.78538678111635-0.1971164727446180.0146132188836501-0.852927344943819
346.46.4376234193637-0.340204553727664-0.0376234193636979-0.443100252369668
356.76.653328408949950.1878152372767420.04667159105004871.63511749661135
366.66.62644266576581-0.0161097996663322-0.0264426657658141-0.631494753731989
376.46.4041331520194-0.211931831054026-0.0041331520194012-0.606586612876887
386.36.28361242048162-0.1250857262490950.01638757951837860.269124863321676
396.26.2095157389639-0.0769735396405751-0.009515738963900270.149396470400398
406.56.492041989792350.2624360747934890.007958010207649191.05063559813044
416.86.788113945529790.2941752828063280.01188605447021040.0982895948557093
426.86.805492778326820.0329419259274602-0.00549277832681824-0.808962585659557
436.46.44149526477237-0.341684370456125-0.0414952647723735-1.16010380687189
446.16.08413228524105-0.3564814608953290.0158677147589512-0.0458220897755935
455.85.7599093543658-0.3260367539095760.04009064563420630.0942779972191758
466.16.145367101869440.345454695558719-0.04536710186944042.07940472039105
477.27.128373263887870.9471647619295330.071626736112131.86331593617394
487.37.346155816979570.258814331735642-0.0461558169795662-2.1316170463579
496.96.93055891689458-0.377588104499472-0.030558916894576-1.97142932402068
506.16.0882733484193-0.8161922453486850.0117266515806964-1.35856658116138
515.85.80312939773405-0.31718610017511-0.003129397734050621.54791396820684
526.26.175680006169380.3314867709387260.02431999383061982.00833139546841
537.17.066520786204050.8572155448012770.03347921379595251.62799411243550
547.77.698998608530040.6459534105992130.0010013914699612-0.654221551016279
557.97.955997228818510.280310792972354-0.0559972288185112-1.13228288505511
567.77.68102995309995-0.2416809843777330.0189700469000546-1.61645008446091
577.47.37941566361595-0.2980212362113460.0205843363840541-0.174468623858556
587.57.580680764289830.171335087180122-0.08068076428983141.45345384493380
5987.904551457027670.3147275858507820.09544854297232670.444044005965626
608.18.128525438079110.229418842255042-0.0285254380791152-0.264176949136665
6188.00403422492856-0.103240101283659-0.0040342249285615-1.03050743528850
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/13xt01259864651.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/13xt01259864651.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/2ehnq1259864651.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/2ehnq1259864651.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/3g7ns1259864651.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/3g7ns1259864651.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/44mw61259864651.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/44mw61259864651.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/54o6j1259864651.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259864807l40oh1x97ipc41m/54o6j1259864651.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