Home » date » 2009 » Dec » 16 »

*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: Wed, 16 Dec 2009 13:58:04 -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/16/t1260997121pxibbzt75icxzpf.htm/, Retrieved Wed, 16 Dec 2009 21:58:49 +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/16/t1260997121pxibbzt75icxzpf.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 «
519 517 510 509 501 507 569 580 578 565 547 555 562 561 555 544 537 543 594 611 613 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
 
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
1519519000
2517517.53488576319-1.50931967068352-0.534885763190245-0.195917433969918
3510511.16081785952-4.83640438677179-1.16081785951987-0.392237856250045
4509508.037137786154-3.592976812579720.9628622138458230.144093393598201
5501501.931210878454-5.38261979234418-0.931210878453754-0.198503448653565
6507504.4814543513770.2252911918271572.51854564862340.62847050025145
7569554.9516422843635.86733187261714.04835771563933.99269021633074
8580586.06202769330632.4901132096203-6.06202769330635-0.378037598250256
9578586.98862447158910.0833547031088-8.98862447158926-2.50841293522469
10565570.172230981533-9.00870670356781-5.1722309815326-2.13730328845535
11547548.41501673278-18.0560584872628-1.41501673278001-1.01281832390928
12555548.559512126371-5.139377894840716.44048787362861.44597793857026
13562558.8378410725755.772746330402813.162158927424941.22544629398114
14561562.3084589066984.13702027413221-1.30845890669831-0.186017119087309
15555557.687050697457-1.87267524876861-2.68705069745723-0.668685054456384
16544542.403886365893-11.03349124577311.59611363410696-1.04188732497722
17537536.684457281772-7.375024416973040.3155427182283010.4098364124012
18543551.2682558076697.6204892170364-8.268255807668651.67404698884967
19594577.46314778263720.292688963978916.53685221736281.41962649034373
20611607.76034613658127.13021510319263.239653863418930.765654019379351
21613619.07358593093816.3148820785158-6.07358593093843-1.21064162342642
22611616.160906983093.16786824404775-5.16090698308993-1.47186502087566
23594604.156010494937-7.20248277329205-10.1560104949366-1.16094206889327
24595593.894944914613-9.290721159862021.10505508538653-0.233853818426585
25591586.786106270801-7.800845356883944.213893729198510.167298240048712
26589584.679424821553-3.90767735957214.320575178446650.436478595201897
27584580.491453784252-4.097419686599763.50854621574841-0.0211877937283579
28573572.376381552077-6.807924533913570.623618447923053-0.305025292554735
29567571.275527873055-2.93767135303228-4.27552787305460.434380592348358
30569581.1398074678155.72276901437693-12.13980746781450.967631686718844
31621604.78345539093517.816255211064816.21654460906541.35334777357137
32629622.91432179453418.02875014368806.0856782054660.0237963385170933
33628631.27318588103311.4919827271705-3.27318588103264-0.731760462375117
34612619.034372715256-4.55084459529663-7.034372715256-1.79597672442147
35595605.602642402641-10.5515908366955-10.6026424026414-0.671780986634648
36597596.117984864524-9.831104197562760.8820151354762520.0807106975335485
37593589.505590051469-7.655941624638813.494409948530930.243935906296182
38590583.826580184859-6.320367957745156.173419815140530.149496513561709
39580574.370230788928-8.428742626874175.62976921107169-0.235737801836184
40574571.936294220964-4.405303676217792.063705779035890.451462185397122
41573578.7752700234563.16303817899002-5.775270023456110.848969328353827
42573590.4236161782468.87255658476506-17.42361617824640.638620028477297
43620604.47895418303812.353194441439515.52104581696240.389364730856851
44626617.41337763249912.74353377010368.586622367501440.0437003858891592
45620618.9484094244445.21095686830471.05159057555633-0.84329004262027
46588599.128070785592-11.6137169992138-11.1280707855923-1.88348049229621
47566578.635295529771-17.5798043371606-12.6352955297715-0.667966338555024
48557557.86847801415-19.7210446513701-0.868478014149465-0.239866377758354
49561552.673817483451-9.955415158732758.326182516549231.09422816963352
50549541.487802219984-10.78214939131257.51219778001625-0.0925134172564313
51532527.86983573287-12.68185172978674.13016426713028-0.212518265865295
52526524.353760526945-6.547670853509961.646239473054650.687590183337382
53511520.026577030717-5.05903817220852-9.026577030716520.166892365403853
54499518.76078483126-2.51522676542611-19.76078483125990.284698009363485
55555535.88464467666710.638550083212919.11535532333341.47152213130353
56565552.4113785176814.580535988965912.58862148232010.441223277411353
57542540.482672361279-3.172637924385871.51732763872071-1.98749946266108
58527534.192382851342-5.26087479406452-7.19238285134166-0.233788317873157
59510523.701322028714-8.76379582719401-13.7013220287140-0.392233342365311
60514518.376693631045-6.46002578594065-4.376693631044810.258046937760827
61517508.663803878302-8.63982328948068.33619612169845-0.244128210074671
62508498.971407597004-9.34465431702039.02859240299631-0.0788689212302369
63493490.464523405607-8.784717945164052.53547659439280.0626554170019082
64490486.563474934858-5.522579600507773.436525065141710.365491028832501
65469480.416519265422-5.94012292608596-11.4165192654216-0.0467943279911121
66478498.69015102432510.260040052035-20.69015102432511.81360380907420
67528511.41831054581111.910007065775716.58168945418890.184608971279338
68534515.1410213507416.4401180024252018.8589786492590-0.612165182048206
69518516.5339982041223.068125128976631.4660017958784-0.377486923997789
70506513.587580086199-0.950712848649473-7.58758008619888-0.449964271024861
71502515.8532485020421.19863293710772-13.85324850204180.240690861429298
72516518.8181083912172.37924407106951-2.818108391217070.132227795184545
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/1z7jo1260997081.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/1z7jo1260997081.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/28f3p1260997081.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/28f3p1260997081.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/36cka1260997081.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/36cka1260997081.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/47r821260997081.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260997121pxibbzt75icxzpf/47r821260997081.ps (open in new window)


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