Home » date » 2009 » Dec » 01 »

ws8

*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: Tue, 01 Dec 2009 10:50:31 -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/01/t1259689891oxec2lt1smv9nue.htm/, Retrieved Tue, 01 Dec 2009 18:51:38 +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/01/t1259689891oxec2lt1smv9nue.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 «
325412 326011 328282 317480 317539 313737 312276 309391 302950 300316 304035 333476 337698 335932 323931 313927 314485 313218 309664 302963 298989 298423 310631 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 300713 287224
 
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
1325412325412000
2326011325942.55084104627.752756355036068.44915895355620.0495217931639672
3328282327718.72094753176.5255332056774563.2790524688350.251364284016571
4317480319986.2585188027.48005821959097-2506.25851880216-1.17182663707953
5317539317443.820704185-5.7879503770284295.1792958145417-0.382385070780442
6313737314384.460827008-22.9290117275542-647.460827007662-0.457691395941157
7312276312519.657431044-34.0127038343482-243.657431043558-0.276031371176660
8309391309980.391879649-49.2462602436357-589.391879649354-0.375443784236939
9302950304397.933526114-82.6566969766221-1447.93352611425-0.82922368442539
10300316300840.562711304-103.476525562518-524.562711303572-0.520727406257012
11304035303054.478701094-89.6800411153306980.521298906120.347285143547759
12333476326654.12308346950.51895564382656821.876916530613.55004922769262
13337698335235.919206305-266.8622256577712462.080793694621.45510683699584
14335932336715.200068716-242.484768370612-783.2000687157710.241364074838444
15323931326237.26315566-433.235918536539-2306.26315566009-1.45975595457309
16313927318390.442015713-507.018859113401-4463.44201571332-1.10617165519554
17314485314626.291099368-522.396857989932-141.291099368494-0.488189608088228
18313218313748.761252682-523.648132440838-530.761252681949-0.0532020740281788
19309664310805.376437261-532.588714541077-1141.37643726096-0.362366830012397
20302963304558.933564481-555.255229640237-1595.93356448105-0.855544881056838
21298989300238.041429651-570.987028556055-1249.04142965143-0.563874815798923
22298423299128.510390822-573.350834141211-705.510390822258-0.0806688149030882
23310631310613.566440552-528.00973337962917.43355944757971.80596068903270
24329765322025.222928121-539.4544753219857739.777071879231.78781619906444
25335083329559.115401028-631.820253073065523.884598972291.25528891756047
26327616326666.588822281-644.617825091323949.411177718565-0.329645300284093
27309119314118.819384524-794.790093684242-4999.81938452365-1.71829631337343
28295916303114.825186792-892.576431540558-7198.8251867916-1.51571341892716
29291413294177.456320278-936.38099634766-2764.45632027818-1.20466977238556
30291542291407.589022158-942.811519159777134.410977841569-0.274670469893185
31284678285795.125263775-957.554687138183-1117.12526377512-0.699316228857779
32276475278771.405241583-978.141342447736-2296.4052415833-0.908305506633994
33272566274508.135275656-990.302102731672-1942.13527565565-0.491951414355052
34264981270422.713778753-1001.49868001539-5441.71377875314-0.463557031641652
35263290267626.089017881-1005.31407252620-4336.08901788113-0.268634185383439
36296806283793.078293823-1034.2282590905913012.92170617742.57470227497034
37303598293129.320970829-1080.6289020562810468.67902917071.57351518540293
38286994285471.127444624-1103.640610728221522.87255537598-0.970935668730854
39276427279858.112439805-1144.26277097603-3431.11243980523-0.657801796744838
40266424273542.62937679-1188.01010664923-7118.62937678974-0.766155339360943
41267153270130.176656009-1200.75931559783-2977.17665600925-0.332625262009254
42268381267359.699037066-1206.726870332441021.30096293444-0.235117805719063
43262522262992.919536849-1216.59631580056-470.919536849454-0.473299442041557
44255542257929.397263980-1228.70437671734-2387.39726398050-0.576123204837344
45253158254454.899598956-1236.03022317791-1296.89959895595-0.336340294217171
46243803250362.364671481-1244.14280049282-6559.36467148068-0.427674492397063
47250741257031.440444633-1234.21333799261-6290.440444632841.18382262104702
48280445266336.422067546-1246.8788919919914108.57793245411.57987078392883
49285257270928.060782321-1256.8000400736214328.93921767920.878027098654857
50270976268845.370561896-1259.163113005852130.62943810352-0.122374520755582
51261076264450.422250399-1280.71886264754-3374.42225039899-0.460536676492489
52255603262408.423617773-1286.28569560455-6805.42361777327-0.112765499690225
53260376262351.837292276-1279.31811543432-1975.837292275950.183644742211955
54263903261637.353775415-1277.035798376212265.646224584990.0845747778931377
55264291262485.069912478-1270.196655580591805.930087522110.318263581732331
56263276263710.672990517-1262.7174509006-434.6729905171240.373832364138744
57262572263126.060137877-1260.78421610747-554.0601378773820.101553242562512
58256167264490.021168332-1254.91654979578-8323.021168332020.392855592228209
59264221270948.083393656-1248.20419905592-6727.083393656121.15377719506950
60293860278477.38456098-1253.6066393701615382.61543902021.31483654014780
61300713284007.174677601-1256.0876076161216705.82532239851.01617355692354
62287224284283.511451435-1252.056783041842940.488548564940.227438010041143
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/1qq0d1259689828.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/1qq0d1259689828.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/2ykzu1259689828.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/2ykzu1259689828.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/3rm9b1259689828.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/3rm9b1259689828.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/4hvwo1259689828.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259689891oxec2lt1smv9nue/4hvwo1259689828.ps (open in new window)


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