Home » date » 2009 » Dec » 11 »

workshop 9 - review link 3

*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, 11 Dec 2009 05:10:52 -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/11/t1260533524e55pxnlogqf9coh.htm/, Retrieved Fri, 11 Dec 2009 13:12:15 +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/11/t1260533524e55pxnlogqf9coh.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 «
5.4 5.4 5.6 5.7 5.8 5.8 5.8 5.9 6.1 6.4 6.4 6.3 6.2 6.2 6.3 6.4 6.5 6.6 6.6 6.6 6.8 7 7.2 7.3 7.5 7.6 7.6 7.7 7.7 7.7 7.7 7.6 7.7 7.9 7.9 7.9 7.8 7.6 7.4 7 7 7.2 7.5 7.8 7.8 7.7 7.6 7.6 7.5 7.5 7.6 7.6 7.9 7.6 7.5 7.5 7.6 7.7 7.8 7.9 7.9
 
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
15.45.4000
25.45.4000
35.65.594929062244670.1867782437487340.002214277154310121.42458337469500
45.75.702526078539670.111016827213531-0.00139554471429272-0.570862247186259
55.85.800089275119910.09814090663470550.000102955835649726-0.0970457396502012
65.85.802352074946810.00637655182629163-0.000982115106944923-0.69161815226378
75.85.79992580436382-0.00204852216016550.000199974492124871-0.0634988920090417
85.95.897436960700770.09323874815028830.001140485195315470.7181700750304
96.16.097555516673130.1955320400494410.0009173355582872180.770973718620297
106.46.397634811006810.2955928777606670.0008713697779453450.754147947587207
116.46.407470167932180.0220980170669061-0.00338713317532346-2.06130182982399
126.36.30237985010868-0.099632308005343-0.000562524741128899-0.917468581237651
136.26.19902993875199-0.1031825135731110.00102306265612186-0.0270898119053488
146.26.20013575468071-0.00702524368577775-0.001508804143861780.723733395498135
156.36.293350517251930.08794273238600120.005266917707305970.713000940592935
166.46.401652903728030.107185462175953-0.001934071703858010.144935730386198
176.56.498849862147980.09773960724538520.00128834281056557-0.0711934804822539
186.66.59969702744860.1006784567295470.0002599747248532040.0221497777472345
196.66.603384845124480.00895520589438013-0.00204285472685143-0.691308465887857
206.66.59881426253884-0.003835998566385690.00137288381643899-0.0964059544292592
216.86.796094257706650.1863574442325090.001123048139958941.43346786040070
2276.996112193138870.1992760595843640.003698796374104870.09736623693722
237.27.201230402039310.204801056751968-0.001311237512046560.0416413826691433
247.37.302972558898330.107350482078810-0.00154679298410702-0.734488431525079
257.57.497426545169420.1896291000908060.001368669083383010.625796016197485
267.67.607031999493950.116016038872831-0.00598900387268696-0.553974498406099
277.67.600149483361850.0006306473357017980.00151138029593659-0.867864757490339
287.77.6972931182460.09106101949241450.001404633396076790.680954470032129
297.77.704641412729450.0125802444187983-0.00350924567481978-0.591513393392292
307.77.69826377207266-0.005194321838341720.00199263523332874-0.133964660063898
317.77.69842050660236-0.0001774146219780830.001507121542147520.037811903148499
327.67.6079138855999-0.0848654138004662-0.00669221133973031-0.638284477413956
337.77.692333028687320.07384705601327790.005377450362013551.19619912826708
347.97.894304334101020.1939709893049790.003962807598711490.905361423552947
357.97.905185056506150.0223077825633996-0.00270871075913092-1.29381480943853
367.97.905384760025760.00158615846250746-0.00508585652124643-0.156192584076223
377.87.80163330806544-0.0971475180939086-0.000206986290705274-0.748851785082806
387.67.60293755832055-0.190476204578409-0.00162045759966602-0.702411224447467
397.47.40363111443934-0.198714039820923-0.00351341290785465-0.062039334267044
4077.00404497532107-0.385837040293015-0.00137521949952675-1.40884139874126
4176.98630874439361-0.04277671951608320.00878708005543462.58566111656610
427.27.191291587443610.1881634292627860.005407113544797861.74056265310308
437.57.488535744445340.2898359474444050.01001083065248260.766295107050017
447.87.809854140419750.319179828001152-0.01027361585291130.221161713028408
457.87.816476751514080.0278539810744289-0.0123122017393184-2.19569223430684
467.77.69431319402758-0.1119763663293450.00768570205743901-1.05388731292599
477.67.60183556242515-0.0938014117586268-0.002095377131864500.136983655418038
487.67.59872646065476-0.009305139633890626.57712675868477e-050.636988803157634
497.57.50101968344662-0.09171984236089420.000160284299135285-0.623779211866528
507.57.5022558913517-0.00631540265347379-0.003458805292995590.642892908591166
517.67.582861938073870.07441825222173250.01599008332873190.608485940145603
527.67.613889783688480.0341521149609615-0.0133185409214909-0.303144393414934
537.97.887817104515070.2567254689366080.00901925292313631.67752712011016
547.67.62245678993505-0.228009411016664-0.0155666882137413-3.65337255024858
557.57.4922631519282-0.1371937842082800.00644596965774240.684467621822883
567.57.49330159412482-0.008857096772600380.004874191179587810.96725999751738
577.67.600379128115030.0987785429623711-0.001909092332945630.81123846432232
587.77.69237375590830.09248003943780960.0077157727802329-0.0474712782275398
597.87.807063407271480.113100172953108-0.007356508332551590.155412221241903
607.97.895427688437350.09014647487838640.00489855096200324-0.173063731784843
617.97.907137470329160.0172968737823766-0.00610054118703283-0.550585766746228
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/1gucg1260533448.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/1gucg1260533448.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/2m1e31260533448.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/2m1e31260533448.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/36y421260533448.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/36y421260533448.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/4ykgv1260533448.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260533524e55pxnlogqf9coh/4ykgv1260533448.ps (open in new window)


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