Home » date » 2009 » Dec » 04 »

Ad hoc techniek 3

*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 06:44:57 -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/t1259934372kfxla38c20ahi4i.htm/, Retrieved Fri, 04 Dec 2009 14:46:18 +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/t1259934372kfxla38c20ahi4i.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 «
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 528
 
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
1562562000
2561561.339634174108-0.68843476512112-0.339634174107586-0.102939394850636
3555556.30167002153-3.53750737950236-1.30167002153033-0.361798347297018
4544546.172760882981-8.09272615414227-2.17276088298104-0.590130913529773
5537536.735724180028-9.011800359879640.264275819972285-0.111732493912854
6543539.04938506565-1.377671969833023.95061493435010.937184990104925
7594580.49430860194527.588328094379213.50569139805523.56271197220082
8611613.8826297872531.5182883941516-2.882629787250270.482653410588391
9613621.98847807324715.6535592313344-8.98847807324663-1.94848619216758
10611616.1151595276531.06969186910092-5.11515952765285-1.79122630472807
11594598.374965528423-11.6711826619275-4.37496552842256-1.56482868994634
12595591.465311091863-8.446083650890353.534688908137520.39610552935425
13591589.01389056506-4.398771146735871.98610943494010.498878384092907
14589587.295628129704-2.581211875934711.704371870295750.226855833739574
15584582.462954841753-4.06266752592251.53704515824712-0.180502321925800
16573573.14714247557-7.48180281364099-0.147142475570026-0.426441453102353
17567568.395244040748-5.68477039906724-1.395244040748070.221656478094008
18569576.3039656132243.19725889977592-7.303965613224151.08661119861124
19621604.10932140727819.222673723571316.89067859272231.96869232053014
20629626.74034332003321.44659470892912.259656679967010.273316763573875
21628635.04930276418112.8657686441724-7.049302764181-1.05381569760183
22612619.824942476355-5.4820767200239-7.82494247635457-2.25358414995367
23595602.87003233706-12.9721761514677-7.87003233706008-0.91996411628555
24597593.55878515879-10.58494996858563.44121484120950.293329406862227
25593589.646999973984-6.232482735513013.353000026015760.536273166054448
26590585.735052774875-4.716935472544.264947225125170.186443412766483
27580576.128187072909-7.882543069105853.87181292709132-0.3876692107905
28574571.679609754655-5.670527667405742.320390245344910.272859198586681
29573576.3875728518371.05036947512808-3.387572851837110.82879433616291
30573588.0214805555757.8982255336608-15.02148055557500.839675465019677
31620604.2965545476513.300068268188415.70344545235000.66276192593235
32626619.48233614382514.51634069722916.517663856174650.149429548313448
33620621.400570973076.38149809770838-1.40057097307061-0.999203236606412
34588600.450234103075-11.2715551472926-12.4502341030745-2.16813123617085
35566577.750520223269-18.6492876437219-11.7505202232692-0.906194760502808
36557556.446677170891-20.3621949186740.553322829109256-0.210538900179225
37561551.744964624392-10.24909239318749.255035375607881.24420719543982
38549542.17575217975-9.810151296806336.82424782024970.0539067498620301
39532528.98393872936-11.98384938071843.01606127063958-0.266600580262813
40526524.104180887514-7.42803736922041.895819112485840.560577218702211
41511518.840730796659-6.03627972179115-7.840730796658960.171377174725085
42499517.654312954973-2.91597887486632-18.65431295497310.383108997287234
43555535.26975542731810.267376707724719.73024457268161.61746664236007
44565553.00462031741615.059046471661911.99537968258370.58841122804794
45542542.38985254972-1.42450813442845-0.389852549719771-2.02469278590887
46527534.957312465606-5.28304715631302-7.95731246560575-0.473936141250455
47510523.486083315946-9.25659062853895-13.4860833159456-0.488141262593637
48514517.587458824783-7.1002426387394-3.587458824783070.265035687803791
49517508.241128634468-8.543432235446948.75887136553227-0.177396633467984
50508499.142652389282-8.899840163434418.8573476107175-0.0437556608483276
51493490.833980783745-8.521237008640922.166019216255090.0464625792082002
52490486.328502361258-5.952676785546923.67149763874220.315796315503607
53469480.072604406743-6.14691457445949-11.0726044067432-0.0238976370997597
54478497.7028018358149.09701864089559-19.70280183581381.87259509707129
55528511.03892731471711.8118521085516.96107268528290.333178849774093
56534515.5051441169377.1118917046654018.4948558830632-0.577010952359098
57518517.4110638082193.780918392412260.588936191781156-0.409113871218731
58506514.369684157575-0.585149174345899-8.36968415757522-0.536337412367532
59502515.8005975612150.70519518619107-13.80059756121480.158541580600858
60516518.2318843868851.8102892578221-2.231884386884960.135812597659675
61528518.8688393135131.058827694703069.1311606864867-0.0923275176192655
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259934372kfxla38c20ahi4i/1its81259934294.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259934372kfxla38c20ahi4i/1its81259934294.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259934372kfxla38c20ahi4i/4kada1259934294.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259934372kfxla38c20ahi4i/4kada1259934294.ps (open in new window)


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