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 07:55:50 -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/t125993858367lszch4f8p906k.htm/, Retrieved Fri, 04 Dec 2009 15:56: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/t125993858367lszch4f8p906k.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 «
611 594 595 591 589 584 573 567 569 621 629 628 612 595 597 593 590 580 574 573 573 620 626 620 588 566 557 561 549 532 526 511 499 555 565 542 527 510 514 517 508 493 490 469 478 528 534 518 506 502 516 528 533 536 537 524 536 587 597 581
 
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
1611611000
2594600.764715726819-10.7943516711373-6.76471572681921-1.79417466550545
3595590.130715219314-10.69220345062684.869284780686240.0135938238352938
4591587.228517321978-5.51620596190893.771482678022370.724337656566066
5589587.518362551015-1.662750317147061.481637448984650.499410966495785
6584584.81072081983-2.34298130283852-0.810720819829668-0.0887250814437027
7573575.314563085944-7.01140140169183-2.31456308594446-0.611703208028301
8567566.466885878727-8.212928323426080.533114121273051-0.157136433768578
9569565.563410628786-3.428857309587813.436589371214470.62555036552411
10621604.87453200195524.539152187486916.12546799804553.65735221006601
11629632.72573242986726.7059716998185-3.725732429866890.283344523304397
12628636.85854439927211.9394895598296-8.85854439927163-1.93093038824835
13612620.927066934544-6.2267084480038-8.92706693454376-2.38476752768488
14595603.453602299613-13.5910085716291-8.45360229961277-0.97884873548042
15597592.9638286582-11.61337644041104.036171341799690.256319207056960
16593589.204349054148-6.680867902958613.795650945851940.654112630564915
17590586.779954141924-3.973171858948163.220045858076040.356670496902642
18580578.073761001415-6.966654840593671.92623899858534-0.389762015972569
19574571.402373026475-6.780884075647282.597626973524570.024279516547364
20573572.149021127488-2.037097110908350.8509788725122510.620873163415635
21573582.4313692020745.73800974653048-9.431369202074161.01671498597325
22620602.60728369657814.851737643953717.39271630342161.19176013189274
23626622.02370878618317.73158913341073.976291213816590.37660135848543
24620625.0515421774088.46621582962653-5.05154217740801-1.21221175899113
25588603.571892883564-10.4094328635746-15.5718928835645-2.4762133653004
26566579.24200625601-19.1958760129663-13.2420062560106-1.15095315601659
27557556.703631738739-21.28884916516750.296368261261291-0.272843819168515
28561551.441627072655-11.31238350463699.558372927345491.30914873959252
29549542.533782437369-9.808193938162526.466217562631410.197665336189131
30532529.381383373013-11.90121791293702.61861662698734-0.273405424219038
31526522.632535179101-8.688314465850233.367464820898600.419478618704594
32511515.466459881514-7.73958239790163-4.466459881514170.124076269173489
33499514.019104682471-3.8133722778245-15.01910468247080.513498786688406
34555533.1601877418510.515898736094121.83981225815041.87377848599719
35565553.70483543853716.773890917338411.29516456146320.818423415510956
36542545.6488292382281.28521689417607-3.64882923822804-2.02704658924266
37527538.058014998981-4.25600353352343-11.0580149989809-0.725774793671245
38510525.673371532448-9.32959979527289-15.6733715324482-0.66340214563967
39514518.610647186793-7.92043704187319-4.61064718679330.183994200324925
40517508.63311278329-9.195793456529748.36688721671029-0.167015905203778
41508499.139423178701-9.380900869530228.86057682129927-0.0242750247298982
42493490.185988416559-9.114942627838952.814011583440590.0347846894223537
43490484.442394824679-7.021113522556545.557605175321020.273474028940806
44469477.444652784926-7.00661571675337-8.444652784925750.0018949568782837
45478494.6336022518738.00675331544998-16.63360225187271.96336642792224
46528509.37326969805312.186068705467318.62673030194670.546590436834772
47534515.9847898093388.7258507208347218.0152101906616-0.452632450021529
48518519.6303232163975.57178393674495-1.63032321639718-0.412767216269535
49506517.2777191778390.649183786890601-11.2777191778392-0.644180662158148
50502518.0751576954880.741221283426512-16.07515769548810.0120297749557840
51516519.4942055509491.16096821078641-3.494205550949310.0548397257549317
52528519.307124723790.3273849457143458.69287527621017-0.109095347491193
53533521.9541588951631.7636125577595611.04584110483650.188159321498297
54536530.3307007427075.862761461428255.669299257292870.536318992376891
55537533.7050068914284.321537708699933.29499310857175-0.201389600791940
56524541.1089923424436.22830744562767-17.10899234244260.249182208264339
57536553.57779636422710.0872894480547-17.57779636422660.504581332978417
58587566.1260112026911.609315631871620.87398879731000.199082830889453
59597577.15428492701411.249865707914219.8457150729865-0.0470290540356877
60581582.0351880421457.30813064230398-1.03518804214537-0.515801062787485
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t125993858367lszch4f8p906k/1q03b1259938548.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t125993858367lszch4f8p906k/1q03b1259938548.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t125993858367lszch4f8p906k/3egtz1259938548.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t125993858367lszch4f8p906k/3egtz1259938548.ps (open in new window)


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


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