Home » date » 2010 » Dec » 16 »

STSM peer review

*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, 16 Dec 2010 17:52:22 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6.htm/, Retrieved Thu, 16 Dec 2010 18:51:21 +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/2010/Dec/16/t129252187584mrtnu6bizjuq6.htm/},
    year = {2010},
}
@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 = {2010},
    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 «
286602 283042 276687 277915 277128 277103 275037 270150 267140 264993 287259 291186 292300 288186 281477 282656 280190 280408 276836 275216 274352 271311 289802 290726 292300 278506 269826 265861 269034 264176 255198 253353 246057 235372 258556 260993 254663 250643 243422 247105 248541 245039 237080 237085 225554 226839 247934 248333 246969 245098 246263 255765 264319 268347 273046 273963 267430 271993 292710 295881 294563
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time6 seconds
R Server'George Udny Yule' @ 72.249.76.132


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1286602286602000
2283042283653.514678328-194.918781431049-611.514678327863-0.513504172651212
3276687278738.112107994-633.581801757586-2051.11210799353-1.10580595409501
4277915277701.909912795-680.252271222706213.090087204625-0.0997065198244274
5277128277271.530240242-645.890768061875-143.5302402419800.0602327365463566
6277103277213.666234932-554.779819817128-110.6662349318740.139143721593626
7275037275809.967354789-696.861674374174-772.967354788608-0.198553808025926
8270150271748.631096895-1287.72185557428-1598.63109689547-0.78068783645142
9267140267979.819544199-1736.67874160150-839.819544198809-0.572582134226973
10264993265323.003050931-1906.33467108155-330.003050931516-0.211571373760679
11287259280417.1309134021265.666843094086841.869086597513.89954991137942
12291186290454.5055914382914.69562417399731.4944085622162.0088718445796
13292300291827.6026693142635.81462614077472.397330685744-0.381768914671608
14288186289105.3061682421630.43337354587-919.30616824152-1.17241415668180
15281477285177.447902346601.232352478222-3700.44790234588-1.19525698085119
16282656283202.099905819121.719278756493-546.099905818812-0.580525201913526
17280190281322.896910550-253.224981554856-1132.89691054965-0.451681847842913
18280408280363.258527809-385.76640759498444.7414721908378-0.158669731712760
19276836277419.915821799-865.538410338143-583.915821798573-0.574248363255685
20275216275491.15769903-1065.00033327702-275.157699030219-0.238969163696083
21274352274611.958751139-1030.13291846558-259.9587511394430.0417967307084539
22271311276026.198911086-571.326758062151-4715.198911086080.55005764334406
23289802282777.257880196802.0263124372577024.742119803611.64583404226181
24290726288224.9158514381670.532245177412501.084148562351.04459985922816
25292300289964.1175762451683.347354447582335.882423754780.015828751956963
26278506281998.089648172-124.045506568646-3492.08964817203-2.15946615518098
27269826274827.818024539-1432.84780051521-5001.81802453924-1.54256078982195
28265861267747.948348433-2481.0253160722-1886.94834843271-1.25987164650344
29269034267801.884705637-2008.27966367891232.115294363170.569696858211719
30264176264104.828719529-2323.8807713108071.1712804712921-0.37826232203378
31255198257203.49419422-3179.21790478733-2005.49419421973-1.02322729611630
32253353253381.570478368-3299.2713841071-28.5704783683416-0.143704090850896
33246057248384.476653014-3616.38993146270-2327.47665301379-0.379863530546178
34235372243648.865106564-3825.38359246229-8276.86510656376-0.250373649485884
35258556248979.766908410-2117.60316727919576.233091590422.04668896015447
36260993255068.423107095-589.4085469147425924.576892905241.84078304131215
37254663251037.498183637-1231.037268367923625.5018163629-0.778868184343224
38250643250527.036653019-1096.54167628592115.9633469809070.161087811175728
39243422247730.699337801-1412.43090814126-4308.69933780114-0.375139009225978
40247105248642.866147849-981.209418361088-1537.866147849000.516878030877219
41248541247027.331471033-1099.160172459651513.66852896716-0.142032433025296
42245039244050.07569262-1449.09026577852988.924307379717-0.420166870291771
43237080239692.625931415-1991.14701737445-2612.6259314146-0.64916543320341
44237085236430.49346715-2227.95474970988654.506532849932-0.283464343975813
45225554229940.029080625-3021.8753196366-4386.02908062471-0.950570012871678
46226839234615.251741445-1589.01479578791-7776.251741445471.71599627009908
47247934238931.841920532-490.6905617792959002.158079468261.31711125399326
48248333240720.334200147-66.99031349206947612.665799853060.510186904837453
49246969242754.735810031324.1513543978604214.264189969390.472008393862723
50245098244328.766295623556.904166872985769.2337043774970.278817456230623
51246263249469.0936537881408.2801782797-3206.093653787851.01476386798951
52255765255350.0999386042237.72036605097414.9000613960930.993370973336029
53264319260783.5575788702831.004442045263535.442421130310.713581227538113
54268347265445.5823494293171.472951531492901.417650570690.409102347320942
55273046272785.3814658063946.95829275335260.6185341939560.929579390203477
56273963273978.8191540893434.81370984221-15.8191540891989-0.613160401588959
57267430275520.9199336633082.95113374645-8090.91993366284-0.421175038917083
58271993280665.5445867713465.97178352948-8672.544586771420.458685689751345
59292710284488.0323698353532.163194881178221.967630165410.0794080017422295
60295881288639.6820494503647.189672795537241.317950549640.138399093199395
61294563291496.4363597773500.269126413783066.56364022347-0.176832484645321
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/1efgx1292521936.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/1efgx1292521936.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/2efgx1292521936.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/2efgx1292521936.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/36og01292521936.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/36og01292521936.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/46og01292521936.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129252187584mrtnu6bizjuq6/46og01292521936.ps (open in new window)


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