Home » date » 2009 » Dec » 15 »

ws 9

*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, 15 Dec 2009 13:39:33 -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/15/t1260909609rg06vp1fjkqv8th.htm/, Retrieved Tue, 15 Dec 2009 21:40:17 +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/15/t1260909609rg06vp1fjkqv8th.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 «
25.6 23.7 22 21.3 20.7 20.4 20.3 20.4 19.8 19.5 23.1 23.5 23.5 22.9 21.9 21.5 20.5 20.2 19.4 19.2 18.8 18.8 22.6 23.3 23 21.4 19.9 18.8 18.6 18.4 18.6 19.9 19.2 18.4 21.1 20.5 19.1 18.1 17 17.1 17.4 16.8 15.3 14.3 13.4 15.3 22.1 23.7 22.2 19.5 16.6 17.3 19.8 21.2 21.5 20.6 19.1 19.6 23.5 24
 
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
125.625.6000
223.723.7748301328505-1.83135417540214-0.0748301328505352-1.44810168374356
32221.9465372012102-1.828587821622490.05346279878977120.00223915999513986
421.321.2147836974749-0.841543776764460.08521630252507750.762499701415953
520.720.6960169894596-0.5516656091205590.003983010540433140.224942038467864
620.420.3864496111449-0.3340394983559090.01355038885507890.168803164391284
720.320.2854751743608-0.1245262408067920.01452482563917640.162510907529433
820.420.38591278391870.07769222192049410.01408721608125040.156852187410448
919.819.8500810490141-0.473795942760007-0.0500810490140693-0.427765696544395
1019.519.4780164212245-0.3823505277534030.02198357877545290.070930282436396
1123.122.81507864763782.961001912453920.2849213523621782.59329494336066
1223.523.73149505767651.12314013941252-0.231495057676515-1.42555047010573
1323.523.5622425604115-0.0377602015796381-0.0622425604114833-0.90134728997822
1422.922.9521955245003-0.552642969998991-0.0521955245002888-0.40294974639098
1521.921.9706969947931-0.922509942553642-0.0706969947931021-0.290274379802242
1621.521.3900118177106-0.625344264288970.1099881822894480.230478927215265
1720.520.5307927472549-0.827683523507809-0.0307927472549413-0.156886744404214
1820.220.1588994712089-0.4330220163103370.04110052879113760.306170675989697
1919.419.4887954702558-0.638360236265276-0.0887954702558011-0.159269963078949
2019.219.0657634775065-0.4518695803813730.1342365224934700.144653294991571
2118.818.6805102261044-0.3941775326635600.1194897738956160.0447492369805966
2218.819.16574069442480.367427207661509-0.3657406944248390.590744251909306
2322.621.94499500681952.456237564406930.6550049931804871.62020863417254
2423.323.56283719451161.73025116135588-0.262837194511553-0.56312255012981
252323.2244276416474-0.0602066067708931-0.224427641647447-1.39058359824642
2621.421.5227040000091-1.48276851213894-0.122704000009090-1.10542355132324
2719.919.9850042003555-1.52962624574123-0.0850042003554598-0.0364664986028825
2818.818.6068530924527-1.399753807884400.1931469075472540.100894234343623
2918.618.5638121856395-0.2399217724623790.03618781436051980.898864720290756
3018.418.3456330967770-0.2213351769014650.05436690322302430.0144194645201181
3118.618.66349997703770.239799162959192-0.06349997703767880.357682098145959
3219.919.61318702948560.8469237110733420.2868129705143530.470919293061608
3319.219.2094264779113-0.222672912896664-0.00942647791128964-0.829640810164218
3418.419.1290634011095-0.100967612841749-0.7290634011095020.0944018439297358
3521.120.32600882516931.009011481797250.7739911748307260.860967642123709
3620.520.65565564492110.428193039487809-0.155655644921101-0.450547456268020
3719.119.2964161808192-1.09994836037982-0.196416180819169-1.18680540313525
3818.118.1709759820258-1.12174323724086-0.0709759820258269-0.0169063811079794
391717.0352854081878-1.13358183698342-0.0352854081877549-0.00919402025465744
4017.116.9665961484334-0.2271267354547290.1334038515666210.704217799230097
4117.417.27576471682220.2288093204037390.1242352831778420.353379938932194
4216.816.8944635864297-0.289560415791683-0.09446358642972-0.402100881756414
4315.315.6214506212061-1.12550080591388-0.3214506212061-0.648429295827709
4414.313.8443364896018-1.679432202108000.455663510398215-0.429656037037202
4513.413.2543344898595-0.7533237522794210.1456655101404530.718344339003485
4615.315.93589152943172.16659309092805-0.6358915294317052.26487757993197
4722.121.04003032794094.663526599544771.059969672059091.93675298877730
4823.723.83026718004253.07172722790736-0.130267180042515-1.23489682234395
4922.222.8068540711887-0.408988081556008-0.606854071188698-2.70245694173248
5019.519.7612055099355-2.64881609368622-0.261205509935523-1.73680562086236
5116.616.7838923072824-2.92676321861172-0.18389230728238-0.215719083988144
5217.316.9630543452069-0.2943578437347790.3369456547930672.04447234367712
5319.819.38607954015362.007911945561790.4139204598464491.78481278060656
5421.221.19058118536761.835712744140420.00941881463237196-0.133558544746134
5521.521.71836438930440.728111053498361-0.218364389304364-0.859176709977856
5620.620.2821364371752-1.105030886382800.317863562824792-1.42187340015066
5719.119.3444888265633-0.96325943109401-0.2444888265632780.109966450751919
5819.620.62826480160240.939906914563213-1.028264801602361.47622697555587
5923.522.34596264447051.598574810947971.154037355529510.510895478470541
602423.68239076040551.376634380167310.317609239594518-0.172190609779713
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/1gxti1260909569.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/1gxti1260909569.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/2isd41260909569.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/2isd41260909569.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/3og6o1260909569.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/3og6o1260909569.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/4wgsh1260909569.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260909609rg06vp1fjkqv8th/4wgsh1260909569.ps (open in new window)


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