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 10:40:16 -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/t1259948467jmfr4yarxhc3ppx.htm/, Retrieved Fri, 04 Dec 2009 18:41:15 +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/t1259948467jmfr4yarxhc3ppx.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 «
92.9 107.7 103.5 91.1 79.8 71.9 82.9 90.1 100.7 90.7 108.8 44.1 93.6 107.4 96.5 93.6 76.5 76.7 84 103.3 88.5 99 105.9 44.7 94 107.1 104.8 102.5 77.7 85.2 91.3 106.5 92.4 97.5 107 51.1 98.6 102.2 114.3 99.4 72.5 92.3 99.4 85.9 109.4 97.6 104.7 56.9 86.7 108.5 103.4 86.2 71 75.9 87.1 102 88.5 87.8 100.8 50.6 85.9
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
192.992.9000
2107.792.6896588715088-0.25540822458787111.48620580950461.5666548067674
3103.595.95711302130810.338734071021193.933284815428451.79029325294979
491.196.83495220218840.423485059763639-6.053275170983920.181397495851078
579.893.2838337171227-0.122637281959-11.0959300621323-1.39024174152871
671.987.7384773189906-0.771104665389701-12.0145288848744-2.17351412427144
782.984.8266931604193-0.994915865053252-0.160115655525621-0.977188508428675
890.184.4284428943173-0.9399338159306765.11280299669930.302467009589666
9100.786.5977434347225-0.68490144539461310.89391132360011.70913723134016
1090.787.7990789197332-0.5457216215514450.8052315803078281.10332943982679
11108.891.1591633714338-0.2837589875181313.04837559893122.39676117711606
1244.185.6522090833307-0.605278927103812-35.1350798057273-3.32701502292999
1393.684.6350834063906-0.6159604430691269.5819190415182-0.32363542878073
14107.485.5008160701826-0.57064264019913619.80851677975051.10129764248051
1596.586.1859164339805-0.5193514285341648.742455271834330.842663491769534
1693.687.3065763966798-0.4425065554489334.386104109221421.03887150098209
1776.586.8948407551352-0.44099857588712-10.42987067551200.0192374399233076
1876.786.678979958388-0.430026620876359-10.23801293101810.142547550202579
198486.3939921811031-0.423195811427058-2.565102180082550.0940317144533676
20103.388.1654160327014-0.32499088496140512.46861315391891.46077392759870
2188.587.6582452075743-0.3326502455449441.06949323662941-0.124355187337928
229988.8199850810234-0.2742254150549778.261767506704941.04369166108818
23105.988.9565083929617-0.25952214084887316.40296793229930.293011771483107
2444.787.9509488890128-0.283202932912098-42.2434226261589-0.544123915405248
259487.4804606057772-0.2880773213905266.7812964543588-0.140928604769788
26107.187.4854477285908-0.28077650812043819.20461306974030.220557366360404
27104.888.6386829232844-0.24294830059182114.19611189750161.06015371103563
28102.590.187212978114-0.1923548103149219.909237879949861.30167389162281
2977.790.5945439357755-0.174649392821282-13.68940632796460.431823045761138
3085.291.4780356024694-0.142886443893557-7.677404547510080.761526374812002
3191.392.3839021929191-0.111625447586399-2.477727208706550.758796171771787
32106.592.9663899001254-0.091459316388035312.60264522168700.506528146446527
3392.493.1821204289992-0.082890093477477-1.198736151612190.226414573086229
3497.592.8154175798178-0.090393121926985.07404912766853-0.211347910648492
3510792.3636135731259-0.099337100974398615.1382138548937-0.271884604166801
3651.192.4024274984616-0.096170759646488-41.49645413133140.104956503193787
3798.692.5912284062815-0.09012671000454835.604594553426210.218340692796258
38102.291.9542646572515-0.10130549707185911.0234045807122-0.419869473713256
39114.392.9807456784587-0.07818241205469119.72113508143060.863179902415187
4099.493.1534977447879-0.07292857211809365.892935413722070.191159228555848
4172.592.6504471578614-0.082119141796351-19.5470088167793-0.326595268933698
4292.393.468368769283-0.0626884545257687-2.429288315409830.682930848028511
4399.494.8012246862116-0.03264269173220242.640824566432651.06073296136916
4485.992.8497014467416-0.0733147859915818-4.24769499770760-1.46360157733441
45109.494.0773542276447-0.046479176409976713.48153570346550.996807334186805
4697.694.3046864070464-0.04103538271619182.905610209657970.210850861143600
47104.793.8986426555385-0.047980749639253211.3238851407079-0.282503396091259
4856.994.2988988694428-0.0398403959701915-38.04403923265140.348537428297218
4986.792.9879798645008-0.0619774904272617-4.45084026349198-0.99191234376584
50108.593.1703345405175-0.057833925168040614.97581840330500.190986099273943
51103.492.2021495834002-0.073123337010830412.5160834006845-0.711500130759697
5286.290.5149500256944-0.100267479626643-1.98051497421404-1.26028062105924
537190.0067661009445-0.107158792933552-18.4174689131130-0.318242879042410
5475.988.5346700753104-0.130259213455715-10.6634088344547-1.06482595409878
5587.187.2752388661739-0.1492858463325071.45682568825914-0.881688871590838
5610288.9819829185483-0.11837973131382410.33054139853501.45174519427050
5788.587.9447125816579-0.1333911629434771.88919545860889-0.720401031225008
5887.887.0453990008443-0.1455926094491861.86974513715388-0.602056475077186
59100.886.802390550314-0.14709998325094314.139875682295-0.0767794008640793
6050.686.5560765552507-0.148589947577902-35.8107748484401-0.078388589618882
6185.986.6456027697475-0.145108503481557-1.095116937946960.188500270170006
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/1jznr1259948413.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/1jznr1259948413.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/27t9r1259948413.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/27t9r1259948413.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/325j81259948413.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/325j81259948413.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/40izq1259948413.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259948467jmfr4yarxhc3ppx/40izq1259948413.ps (open in new window)


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