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 08:18:11 -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/t12599399363im4a2kr5rgpw1u.htm/, Retrieved Fri, 04 Dec 2009 16:19:03 +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/t12599399363im4a2kr5rgpw1u.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 «
274412 272433 268361 268586 264768 269974 304744 309365 308347 298427 289231 291975 294912 293488 290555 284736 281818 287854 316263 325412 326011 328282 317480 317539 313737 312276 309391 302950 300316 304035 333476 337698 335932 323931 313927 314485 313218 309664 302963 298989 298423 301631 329765 335083 327616 309119 295916 291413 291542 284678 276475 272566 264981 263290 296806 303598 286994 276427 266424 267153 268381 262522 255542 253158 243803 250741 280445 285257 270976 261076 255603 260376 263903 264291 263276 262572 256167 264221 293860
 
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
1274412274412000
2272433272915.331243222-1536.53084384839-482.331243222391-0.338623654549409
3268361268799.122134470-3330.92334833379-438.122134470516-0.366553965051034
4268586267702.224607973-1681.87956001712883.7753920274050.327333273611194
5264768265200.843148832-2274.29443580010-432.843148832322-0.113348645025418
6269974268402.8950450341663.724063989671571.104954965740.760817481143181
7304744297595.16817027521522.71820839707148.831829724533.83338305917547
8309365313331.83441131917346.1506062469-3966.83441131916-0.80577986934487
9308347312843.3040414164473.9524022405-4496.30404141599-2.48363393347098
10298427301377.69301121-7028.25884105017-2950.69301120984-2.21925759154732
11289231289315.814875962-10660.3341628797-84.8148759619235-0.700776746326481
12291975288777.280434597-3356.683942549993197.719565403261.40917605416842
13294912293435.9874095442412.343088252411476.012590455971.11643885302276
14293488294349.8081374791329.74388416496-861.808137479141-0.212154989716284
15290555291817.282139443-1360.26157505993-1262.28213944288-0.516326195110005
16284736283538.793642386-6168.466646262591197.20635761359-0.94228338928797
17281818281539.16125601-3253.0152011637278.8387439900420.562316101522241
18287854291768.189042686101.27162921385-3914.189042680281.80073141511293
19316263307372.74527280212693.26564340278890.254727198151.27283035286210
20325412324635.16231639515867.7251346493776.8376836048830.612594340477746
21326011329293.4536993498077.09122190138-3282.45369934933-1.50303440573641
22328282330488.1680140753293.99277009526-2206.16801407532-0.92291927674726
23317480323033.844223356-4173.15771833449-5553.84422335603-1.44073534577277
24317539316907.866059615-5528.44574163976631.133940384718-0.261574900572907
25313737311841.338563644-5207.83677798061895.6614363560.0620445930500974
26312276310242.176924113-2699.961318231182033.823075887030.48457626913015
27309391307433.771479096-2774.548197423771957.22852090356-0.0143576268861385
28302950302579.582375682-4200.99390913032370.417624318211-0.276731279725493
29300316302623.141363542-1275.18837928434-2307.141363542060.565653289124374
30304035309533.6262295614350.95791795764-5498.626229561491.08344699943344
31333476324302.06444766511496.38921113629173.935552334811.37844749665445
32337698335079.82592218211002.98184919482618.17407781818-0.0952285138832852
33335932339343.3675799336372.3738702567-3411.36757993327-0.893408862725439
34323931327750.312711212-5971.75098031309-3819.3127112124-2.38177187122071
35313927318827.285108482-7998.57151110695-4900.28510848161-0.391063486422027
36314485313287.526171904-6311.02019177991197.473828095860.325809075495368
37313218311163.057735359-3435.594928785182054.942264640920.555785712657227
38309664307129.721157627-3846.002143634222534.27884237343-0.0791743990660157
39302963300096.480708253-6023.430391656722866.5192917471-0.419638235748755
40298989297944.395443389-3382.540925871791044.604556611270.510806462926683
41298423301737.4216430171526.54342605722-3314.421643016500.948859165191138
42301631309852.9178138616031.32613545839-8221.917813861060.86831949760896
43329765320537.6865762929207.065238999889227.31342370770.612377861916892
44335083330546.9846880849754.659156165354536.015311916410.105666367668587
45327616328591.3910991181755.99730782869-975.39109911816-1.54332240936234
46309119315616.708271650-8306.8081279278-6497.70827165035-1.94153739068852
47295916302611.768810427-11515.0378159255-6695.76881042693-0.619061199676495
48291413291415.209160826-11297.5891894284-2.209160826062560.0419824445006785
49291542286805.098485379-6728.786457480184736.901514620530.882345691589225
50284678280371.265399233-6527.418057212854306.734600766870.0388369324957708
51276475273925.579591636-6471.782305162472549.420408363920.0107275180853488
52272566272134.750884506-3288.09072248932431.2491154937530.615117379832908
53264981270572.314117175-2112.31218835307-5591.314117175150.227162822934790
54263290273017.474821697993.23971692474-9727.474821696880.598958672270499
55296806285819.1631015559029.5910243193710986.83689844541.54959489239122
56303598295852.3866458599712.435037252657745.613354141470.131737935167007
57286994288017.905979002-2230.76950886559-1023.90597900196-2.30443859788108
58276427281589.037515802-5088.57497282072-5162.0375158016-0.551414775741474
59266424274020.912884393-6776.25253728809-7596.91288439303-0.325687245836188
60267153268704.926201171-5782.21809663462-1551.926201171430.191897923184899
61268381263247.580490331-5560.983869693695133.419509669130.0427053105037236
62262522257671.846846112-5571.020863964024850.15315388839-0.00193572589164921
63255542253324.760672138-4739.75657158732217.239327862160.160319977754258
64253158251823.021642463-2541.71591360131334.978357537460.42447042335363
65243803251048.122718691-1340.92573154174-7245.12271869070.231922251871647
66250741262013.2231622097025.47664613629-11272.22316220941.61409515775317
67280445270261.6528272587856.2138711989610183.34717274170.160200631772948
68285257273298.7694069404584.2789612355211958.2305930596-0.631159446778872
69270976272059.522662531629.96068160073-1083.52266253091-0.762968725238057
70261076266969.333068304-3254.64318426131-5893.3330683036-0.749588609510796
71255603263581.089840154-3345.37531792361-7978.08984015428-0.0175108783568468
72260376261541.563047107-2458.31745417709-1165.563047106580.171228690293025
73263903258529.380506851-2834.637055128405373.61949314855-0.0726227965228684
74264291258408.663443331-991.9838517395625882.336556668820.355379863651439
75263276260583.5931081521155.296336831212692.406891848020.414183124611897
76262572261992.5522860781327.23020441511579.4477139223410.0331942251311679
77256167266871.4730092073736.65873814838-10704.47300920720.465263807487358
78264221275268.6200191426899.5263959274-11047.62001914210.610293302613554
79293860282526.9915802117142.9189576903711333.00841978930.0469412918028616
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599399363im4a2kr5rgpw1u/1ski51259939888.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599399363im4a2kr5rgpw1u/1ski51259939888.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599399363im4a2kr5rgpw1u/48ed71259939888.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599399363im4a2kr5rgpw1u/48ed71259939888.ps (open in new window)


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