Home » date » 2009 » Dec » 02 »

ws9(2)

*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, 02 Dec 2009 14:48:13 -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/02/t12597905434m8sc32a2xgf2js.htm/, Retrieved Wed, 02 Dec 2009 22:49:22 +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/02/t12597905434m8sc32a2xgf2js.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 «
216234 213587 209465 204045 200237 203666 241476 260307 243324 244460 233575 237217 235243 230354 227184 221678 217142 219452 256446 265845 248624 241114 229245 231805 219277 219313 212610 214771 211142 211457 240048 240636 230580 208795 197922 194596 194581 185686 178106 172608 167302 168053 202300 202388 182516 173476 166444 171297 169701 164182 161914 159612 151001 158114 186530 187069 174330 169362 166827 178037 186412 189226 191563 188906 186005 195309 223532 226899 214126
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1216234216234000
2213587214477.181578230-1830.38714480497-890.18157823028-0.39479893349566
3209465209827.776322188-3680.183873355-362.776322187599-0.33994872187352
4204045204418.526126059-4877.81228434098-373.526126059336-0.224145044258044
5200237199912.724765473-4623.02694404524324.2752345265760.0447853618394943
6203666201577.920789916-375.5222130585052088.079210083870.754017126473183
7241476231683.74818366320286.08194321279792.251816337443.67433989511235
8260307260697.08433500726211.6813865841-390.084335006971.05224332628533
9243324255302.8589815834750.96165544077-11978.8589815831-3.81108721658072
10244460245969.507346691-4810.34385832014-1509.50734669066-1.69798373655502
11233575234448.121881445-9365.40693011369-873.121881445027-0.808911182158405
12237217233621.72911782-3569.825000217873595.270882179871.02920968741838
13235243234448.999317957-594.937579165195794.0006820430060.530187414592767
14230354231487.733683511-2202.77240311391-1133.73368351057-0.290158593620246
15227184226389.049191915-4111.79879594066794.950808084671-0.336336347303463
16221678220112.165410824-5523.987200581811565.83458917626-0.254681916560283
17217142217319.207638779-3722.61739222962-177.2076387785390.321211514433398
18219452225574.0737385684118.63235016086-6122.073738567771.38708366320003
19256446246288.85601264214948.57351128610157.14398735851.92374910746258
20265845258827.95498047913373.18624631377017.04501952103-0.279940690474034
21248624259837.7629183145281.72057677067-11213.7629183136-1.43681442840166
22241114246096.84742379-7168.52294247772-4982.84742379007-2.21108948209455
23229245233605.498697259-10650.5840068462-4360.49869725849-0.618383956824398
24231805227827.192949423-7467.02543547793977.807050577030.565603424674838
25219277218543.624534856-8654.23149439876733.37546514395-0.211501834754061
26219313215992.168336011-4660.449573681183320.831663989320.71039202623335
27212610210179.950654399-5407.540799784172430.04934560058-0.132288676925589
28214771210854.180975122-1481.966390475483916.819024878440.700184460883853
29211142214841.0252232562066.75062721389-3699.025223255680.632709485648814
30211457223122.9406838996096.0388137432-11665.94068389930.714353567549834
31240048230441.9568304426886.251562942359606.043169558020.140188518068640
32240636231564.3891061163161.077870520519071.61089388379-0.661749836521446
33230580234650.3840577073112.49731290947-4070.38405770683-0.00862787527067449
34208795218734.187169042-9202.46609052241-9939.18716904172-2.18694549691350
35197922204202.905219426-12649.5276759828-6280.90521942641-0.6121891033156
36194596190122.423514331-13574.7295112674473.5764856685-0.164426694542214
37194581190251.101893247-4707.744281960864329.898106752751.57733900903130
38185686182988.429579636-6360.541822852072697.57042036405-0.293491191252335
39178106176859.121284027-6211.613176204131246.878715972600.0264108176182695
40172608170764.884649402-6136.189652638541843.115350598470.0134191535255904
41167302171497.339101412-1710.96625017192-4195.339101412200.78787019449899
42168053178477.2914906453891.65135072021-10424.29149064530.994589206368886
43202300190018.1068497338812.9156805698312281.89315026660.87303164596816
44202388195001.0899908676350.434887120917386.91000913265-0.437232023869609
45182516184852.724262001-4263.76325082504-2336.72426200113-1.88509875979197
46173476180114.036656314-4569.38692897991-6638.03665631371-0.0542776617268997
47166444173617.799436375-5809.12872835949-7173.79943637479-0.220209075636228
48171297170483.167250836-4088.2521850003813.8327491640850.305824936134334
49169701164676.579226762-5194.545355098175024.42077323782-0.196622435415268
50164182160119.692223411-4784.272326634964062.307776588600.0728281882559792
51161914158822.518977709-2546.590723858173091.481022290630.397062001356254
52159612159426.398381158-527.463891824144185.6016188421210.358942433469935
53151001159375.049523596-221.861061375823-8374.049523596150.0543642486848535
54158114168868.9993127826019.4993300538-10754.99931278181.10855163258835
55186530173678.9210731255243.3241558322612851.0789268747-0.137731493842675
56187069175021.2557753172742.3721201044912047.7442246825-0.443955593424929
57174330176604.2024867301999.03500934169-2274.20248672969-0.132007690850250
58169362176282.125291881510.600391879073-6920.12529188148-0.264371078849236
59166827175188.700349993-518.085727951854-8361.70034999336-0.182749363677611
60178037175800.558907678206.7832872250792236.441092321940.128806519531542
61186412180014.0728645912778.024523775366397.927135408550.456780487556198
62189226185377.1191041394435.708153362543848.880895861470.294238190255126
63191563189375.1948387264155.572410894372187.80516127351-0.0497219247628187
64188906190385.5143802672143.79154419358-1479.51438026679-0.357512665973949
65186005196606.2228903394754.09175784515-10601.22289033890.464137381115021
66195309204886.2727074397013.35614700393-9577.272707439050.401351579474383
67223532210211.2930338495932.2149956461913320.7069661513-0.191894445648607
68226899214691.9192096235003.5364751445912207.0807903768-0.164841281353842
69214126216343.3880230122859.71232736978-2217.38802301183-0.380687409990829
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/1uetd1259790489.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/1uetd1259790489.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/2tyjb1259790489.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/2tyjb1259790489.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/3hskk1259790489.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/3hskk1259790489.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/4sb8i1259790489.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t12597905434m8sc32a2xgf2js/4sb8i1259790489.ps (open in new window)


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