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 05:35:38 -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/t12599302292fxlbnfvq1dcq16.htm/, Retrieved Fri, 04 Dec 2009 13:37:16 +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/t12599302292fxlbnfvq1dcq16.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 «
111,5 108,1 124,5 106,3 111,1 121,3 116,5 117,4 123,6 98,4 107,2 118,9 111,9 115,2 124,4 104,6 117 126,2 117,5 122,2 124,1 105,8 107,5 125,6 112,1 120,1 130,6 109,8 122,1 129,5 132,1 133,3 128,4 114,7 114,1 136,9 123,4 134 137 127,8 140,1 140,4 157,8 151,8 141,1 138,8 141,1 139,5 150,7 144,4 146 143,6 143,1 156,4 164,8 145,1 153,4 133,2 131,4 145,9
 
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
1111.5111.5000
2108.1111.6943335935430.127013872581406-3.59433359354289-0.63308613142944
3124.5113.8595022167850.35252942280118610.64049778321491.85061668043858
4106.3113.8078328292660.293628585121169-7.50783282926601-0.191021354181433
5111.1113.0879481637150.143816037535123-1.98794816371468-0.504153550667496
6121.3114.7229762806640.3683388490704136.577023719335860.901036140166431
7116.5115.8513791599760.4870608582491450.648620840024180.519111210471918
8117.4116.7996987252080.5617166696609620.6003012747916850.325578326389754
9123.6118.8033929080980.7999957733340334.796607091902390.999850840559043
1098.4115.579931324030.130765004234486-17.1799313240299-2.7057330315737
11107.2111.993331465076-0.48687766624061-4.79333146507598-2.44171696709596
12118.9111.475457858815-0.4920122226942107.42454214118519-0.0201158081528456
13111.9111.454087945391-0.4157811527036320.4459120546089220.299070875450645
14115.2113.278967216213-0.05436706741906711.921032783787331.47045151018923
15124.4114.2594676737840.11440985255376510.14053232621550.692414475799659
16104.6114.4400104836470.125290776566171-9.84001048364680.0434177310168511
17117115.9665656928060.3554520566347841.033434307194390.891823827221471
18126.2117.7139924771340.5823820957158098.486007522865840.872737737015678
19117.5118.3138724406470.58521781400367-0.813872440646780.0110270777487032
20122.2118.9940249862900.6005854797909613.205975013710310.0605905716932384
21124.1118.4892586890750.4212502341463545.61074131092486-0.710783979844778
22105.8118.8660618614380.414021999495885-13.066061861438-0.0285278147017121
23107.5117.9849673439670.203348946180801-10.4849673439667-0.825035231188455
24125.6118.1509397645850.1972800860949687.44906023541487-0.0236515649307427
25112.1117.4692058287840.0548923065535816-5.36920582878395-0.555339070831884
26120.1117.7077771208670.0846080616756892.392222879133310.116406154096969
27130.6118.7671054476300.24234832262682511.83289455236980.620056876784354
28109.8119.9325182628790.391877855355108-10.13251826287860.58767018920538
29122.1121.0316390967610.5065024565343441.068360903238940.449224608095414
30129.5121.5702453932770.5117034167303827.929754606722820.0203314054282976
31132.1124.2870293659350.8686261680183647.812970634064521.39468847291033
32133.3126.7579008242071.127812053947576.542099175792631.01412924641963
33128.4127.1170791051041.003481410498541.28292089489587-0.48718982844723
34114.7127.4193543719640.890023051481278-12.7193543719638-0.444757558497701
35114.1127.1441220163220.701431273256025-13.0441220163224-0.73875355369403
36136.9127.7516110640370.686227621354599.1483889359626-0.059498039007574
37123.4128.7708866483160.740114177803186-5.370886648316440.210789168182076
38134130.5252848175860.9041805170526743.474715182413710.641954145409312
39137130.8137140305250.8045884387716526.18628596947451-0.389891912572933
40127.8133.1214405339921.04772437602999-5.321440533991520.952133263165548
41140.1136.1633990204031.370331068223923.936600979597171.2631897626605
42140.4137.6010401409691.381220115085732.798959859031360.0426224261677001
43157.8141.4734493783681.7842037629615816.32655062163211.57700346908746
44151.8144.3092292660421.954293765987897.490770733957620.665623970757335
45141.1144.9209021931701.73714014273204-3.82090219317019-0.8499474175402
46138.8147.0121742909431.79441735235743-8.212174290942740.224217992581392
47141.1150.2255088335532.02392126796341-9.125508833553130.898426826833146
48139.5148.1567889344331.36193873750189-8.65678893443319-2.59116961149216
49150.7149.7093175863891.392766186709420.9906824136108660.120654114863056
50144.4149.2610573295141.09499437839259-4.86105732951403-1.16540230402029
51146147.9838717132310.711322689297049-1.98387171323054-1.50165922444738
52143.6148.4752358572240.675747215515352-4.87523585722414-0.139247746956525
53143.1147.2878220782140.374401596630297-4.18782207821431-1.17953801087730
54156.4148.8063346861660.559450891571397.593665313834270.72430981888555
55164.8149.7018928375570.61381312860780915.09810716244310.212773460217785
56145.1147.3767804448940.1384736042569-2.27678044489416-1.86043771151726
57153.4148.4181493987700.2845056420719514.981850601230340.57156099990177
58133.2147.0975127568490.0248951325389817-13.8975127568485-1.01612175251219
59131.4144.112644160618-0.461895332698342-12.7126441606177-1.90533519273149
60145.9144.547294532076-0.3168900067883261.352705467924150.567560377545531
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599302292fxlbnfvq1dcq16/14pq11259930133.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599302292fxlbnfvq1dcq16/14pq11259930133.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599302292fxlbnfvq1dcq16/22p5n1259930133.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599302292fxlbnfvq1dcq16/22p5n1259930133.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599302292fxlbnfvq1dcq16/31mtj1259930133.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599302292fxlbnfvq1dcq16/31mtj1259930133.ps (open in new window)


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


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