Home » date » 2009 » Dec » 04 »

workshop 9

*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 04:56:14 -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/t12599278428529s1fvb4mxlul.htm/, Retrieved Fri, 04 Dec 2009 12:57: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/t12599278428529s1fvb4mxlul.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 «
0.6348 0.634 0.62915 0.62168 0.61328 0.6089 0.60857 0.62672 0.62291 0.62393 0.61838 0.62012 0.61659 0.6116 0.61573 0.61407 0.62823 0.64405 0.6387 0.63633 0.63059 0.62994 0.63709 0.64217 0.65711 0.66977 0.68255 0.68902 0.71322 0.70224 0.70045 0.69919 0.69693 0.69763 0.69278 0.70196 0.69215 0.6769 0.67124 0.66532 0.67157 0.66428 0.66576 0.66942 0.6813 0.69144 0.69862 0.695 0.69867 0.68968 0.69233 0.68293 0.68399 0.66895 0.68756 0.68527 0.6776 0.68137 0.67933 0.67922
 
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
10.63480.6348000
20.6340.634043775797653-4.14019524637114e-05-4.37757976527463e-05-0.0565668498210342
30.629150.629298612086866-6.71087687042004e-05-0.000148612086866151-0.586282872673047
40.621680.62187555040857-9.54878514834116e-05-0.000195550408570217-0.916754315403155
50.613280.61350953878865-0.000129179058897638-0.000229538788649658-1.03071856535967
60.60890.609073231484365-0.000146714463847507-0.000173231484365154-0.536774383662716
70.608570.608696633837391-0.000147646354980016-0.000126633837391283-0.0286488862045854
80.626720.62648368734009-7.52387586440856e-050.0002363126599106952.23507033236324
90.622910.623158572386925-8.83067050178318e-05-0.000248572386925168-0.405005076359817
100.623930.623980071198226-8.46629737372267e-05-5.00711982260674e-050.113380616132610
110.618380.618583019749126-0.000105853988011067-0.000203019749126295-0.662028516588124
120.620120.620159255051431-9.91708255689625e-05-3.92550514314409e-050.209619928023016
130.616590.6170031622466812.92164355971801e-05-0.000413162246681057-0.458181136186446
140.61160.61172367305957-9.62159322930973e-05-0.000123673059570553-0.565838730284064
150.615730.615638075615706-8.12126883100111e-059.19243842942786e-050.499172265384509
160.614070.61422240380813-8.35026903415249e-05-0.000152403808130171-0.166136859688344
170.628230.627848756999033-5.70994857941775e-050.0003812430009672661.70679881994831
180.644050.643632160286069-2.59968424773669e-050.0004178397139313481.97205033985364
190.63870.639348957373977-3.43360630986668e-05-0.000648957373976545-0.529996744075801
200.636330.636063640363847-4.06895915146999e-050.000266359636152796-0.404726978093259
210.630590.630973264012296-5.05368691862032e-05-0.000383264012296115-0.628653264124264
220.629940.629839786313649-5.26512621167694e-050.000100213686350915-0.134819617225985
230.637090.637024948473746-3.78276911356679e-056.50515262541327e-050.901158016531734
240.642170.642014441243823-3.09817630615673e-050.0001555587561769720.625615995978485
250.657110.654008914474841-0.0002573478368126890.003101085525158941.63678159256294
260.669770.66961027501545-2.56648881213365e-050.0001597249845498671.80766020185603
270.682550.6818087620907371.67866286643057e-050.0007412379092633251.52002415379452
280.689020.6892039080630362.54321665369694e-05-0.0001839080630363990.918347673317461
290.713220.7123399568911855.54116653666675e-050.0008800431088149822.87629889279836
300.702240.7024363201611954.17709080785731e-05-0.000196320161195255-1.23947832711184
310.700450.7009174793983243.96302418008324e-05-0.000467479398324185-0.194229980239109
320.699190.6987572470246073.66210427634495e-050.000432752975393434-0.273789348114225
330.696930.6971660021312533.43985842123414e-05-0.000236002131253049-0.202599722514456
340.697630.6975716342116253.49139008352257e-055.83657883744542e-050.0462037325089274
350.692780.692876649737952.77410337120586e-05-9.66497379507568e-05-0.588777664628847
360.701960.7016439000961793.06730087737229e-050.0003160999038210471.08709314853119
370.692150.6936464650373950.000123725102927740-0.00149646503739542-1.05565262408303
380.67690.677774149404473-4.01267637211755e-05-0.000874149404472806-1.87796195030779
390.671240.670808719195376-6.3736237328819e-050.000431280804623693-0.86034447248294
400.665320.666796169630104-6.77111726352793e-05-0.00147616963010449-0.491449036653395
410.671570.670140900869694-6.43008226161582e-050.001429099130305920.424652272371464
420.664280.664879176953151-6.99999802085563e-05-0.000599176953150763-0.646772973962655
430.665760.666111268803962-6.85552083535888e-05-0.0003512688039622950.162033934744073
440.669420.668880849640045-6.5417368908221e-050.0005391503599553560.353180905761929
450.68130.681053688418615-5.18824598589055e-050.0002463115813847711.52294352820467
460.691440.69083976047504-4.05243196551376e-050.0006002395249602721.22430799130474
470.698620.699022640706795-3.02642941436875e-05-0.0004026407067949361.02354165671426
480.6950.694839967600024-2.92302417333965e-050.000160032399975887-0.51647898515867
490.698670.69773954557356-5.26236211033291e-050.0009304544264402820.378248018047598
500.689680.690621020073305-0.000106723052281708-0.000941020073305363-0.843503353862849
510.692330.691554537969385-0.0001032327138222520.0007754620306146950.129121422277859
520.682930.685073982292132-0.000109541623784688-0.00214398229213170-0.793672419050343
530.683990.682372306989461-0.0001117033526537550.00161769301053887-0.32255152923866
540.668950.67026899634846-0.000122950053434896-0.00131899634845996-1.49214259168660
550.687560.686706940139958-0.0001069688633471860.0008530598600415342.06070863365380
560.685270.685565481695672-0.000107964890983330-0.000295481695672165-0.128723757344901
570.67760.678307580003903-0.000114901390153306-0.000707580003903233-0.889688491672784
580.681370.681022276578974-0.0001119594417273450.0003477234210257530.352123305817686
590.679330.679700968497827-0.000113231299108571-0.00037096849782673-0.150509747255192
600.679220.67925632172993-0.000113030941972195-3.63217299293497e-05-0.0412272507041686
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599278428529s1fvb4mxlul/1gknz1259927771.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599278428529s1fvb4mxlul/1gknz1259927771.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599278428529s1fvb4mxlul/36uws1259927771.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599278428529s1fvb4mxlul/36uws1259927771.ps (open in new window)


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


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