Home » date » 2009 » Dec » 06 »

review WS 9 structural time series models

*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: Sun, 06 Dec 2009 13:39:30 -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/06/t1260132157g4t24votr7y8bs6.htm/, Retrieved Sun, 06 Dec 2009 21:42:44 +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/06/t1260132157g4t24votr7y8bs6.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 «
2360 2214 2825 2355 2333 3016 2155 2172 2150 2533 2058 2160 2260 2498 2695 2799 2947 2930 2318 2540 2570 2669 2450 2842 3440 2678 2981 2260 2844 2546 2456 2295 2379 2479 2057 2280 2351 2276 2548 2311 2201 2725 2408 2139 1898 2537 2069 2063 2524 2437 2189 2793 2074 2622 2278 2144 2427 2139 1828 2072 1800 1758 2246 1987 1868 2514 2121
 
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
123602360000
222142312.07185528361-6.09728971493757-10.4814504587985-0.503823320444186
328252486.4795383012112.029899271306037.98448062315171.76515815669492
423552448.680991414288.04694318022202-8.2138867659148-0.497455912616607
523332411.583929124645.049685592303861.66131960561733-0.462897298598276
630162611.9583518059716.209939953366045.99227765837172.05073021813675
721552472.54685420778.33551524132652-25.2704786803007-1.6650203457865
821722375.620536251773.51007807127923-2.24116510491916-1.14262590815467
921502302.678939706940.278209027686111-4.37049592090061-0.839005633276679
1025332374.459844104453.1034212647229118.36994048464870.791198574481487
1120582276.91686153069-0.651484681150949-20.0272748430463-1.12072730933494
1221602237.80471816400-2.01665279708150-1.32577296413176-0.430376487549795
1322602234.98380115384-1.9258207451082227.2212796857331-0.0135582763221846
1424982333.399028678892.143573524625721.688578562051110.963772746803275
1526952448.393528907086.6033354170983754.54115043674431.13358629261098
1627992571.2479915895210.534525277192716.17979546394171.23318890829615
1729472703.1618996553114.100819070645713.82057884124011.33046031264561
1829302769.5666371984815.471376849335958.89281551093940.584648547189137
1923182646.9806247964112.1681906169619-56.9107432447787-1.56206758493857
2025402614.0271404329411.163354808685215.7596577450187-0.514552001978047
2125702606.6482836811310.77325380976290.488353433914017-0.212558377597882
2226692621.6383820348610.858006812817138.87808153530530.0485147752708763
2324502579.134100074899.8274210650839-21.4206433738035-0.615559654652054
2428422660.9479830956111.058961839481434.82572328876540.833855510537335
2534402886.324134603031.6738175798809451.1881229973342.97836615147476
2626782839.518777232060.562390348888481-73.4366766160979-0.517168659177117
2729812873.162104750391.4177428629831747.91682494648820.35405989640968
2822602691.71310925119-2.75118549557304-87.9583997277819-2.01893954347535
2928442730.57594456748-1.9200249989936633.1521730635340.469256678942312
3025462656.79381526752-3.2064103264151730.049394039541-0.820940676054125
3124562610.984367479-3.9061159190136-70.65184050281-0.490649390332296
3222952511.75830313100-5.3707336568113-26.8606337874650-1.1035133652903
3323792468.93353149858-5.91732909600921-14.9989100389308-0.435104908455723
3424792456.85838204709-6.0035792421302134.4979595261797-0.0717062016589342
3520572349.75968351681-7.3552746871455-89.3865954923687-1.17950114685758
3622802322.58955430596-7.56062708489063-2.41419156589651-0.232359517512022
3723512287.53802422025-6.91536097947537124.168319463426-0.357766165566186
3822762299.77167985541-6.63001852927053-60.02694728449220.213490258175437
3925482348.08905197103-5.5706070732494197.86007511504780.605719354125933
4023112365.36307795246-5.16722818613402-97.76074409381450.256817895904591
4122012301.40705814395-6.0858106723234113.4272814764400-0.671434143825295
4227252407.08488840604-4.5167353766538298.80740987142471.28949247609095
4324082424.60731875143-4.23249209061842-60.15349052693510.255911638474619
4421392345.53963502971-5.13679192547475-57.9302577934933-0.872537064377107
4518982211.79820162133-6.61512455961682-57.5591676010272-1.50353655325922
4625372277.96735580523-5.81304532325085113.6685308091220.852553327350742
4720692240.82572657119-6.13564051572941-109.098359702545-0.367629344962183
4820632182.91872516131-6.49488393213439-15.3831744507752-0.610944330033546
4925242235.98447140751-7.31405058614799160.8827573801080.749725942233221
5024372314.76552887464-6.4056679745918-43.93624760924440.98213554386673
5121892250.30058657887-7.2925730369801648.1170304956805-0.65160067825887
5227932428.3741042231-4.5892848565675910.49868504660052.10641698339533
5320742335.30614196911-5.74716880791852-89.7567989202613-1.01798149709272
5426222382.82207958888-5.11866050924947134.8389024519370.618033780480188
5522782362.96009068093-5.27856545732531-55.8860781174464-0.172007948654729
5621442304.28415280321-5.82119236018597-54.5299604488134-0.625171885663563
5724272353.07773814699-5.29364767372799-34.55385167043710.64091858745992
5821392255.44894550371-6.1434412646315567.3433823392528-1.08541249282018
5918282152.31441886992-6.95320847066517-130.736536972702-1.14223313958602
6020722127.95099970961-7.04066723065633-20.9175276022442-0.206202918854760
6118001994.25102727495-5.9999928865758470.3221695240682-1.56346128657037
6217581924.42350806582-6.51009920322493-41.9747155219494-0.737738361564623
6322462007.67258776075-5.3847069257033967.41856423862991.01983569746544
6419871993.53473924339-5.4937982258472310.2607411200347-0.10021392832232
6518681983.01384121028-5.55098586876803-105.255784181258-0.058124904806395
6625142091.10432427825-4.37882657175151200.3632020416061.32356497331593
6721212115.25863604306-4.10806931066608-50.46133559737480.333929708904055
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/1h3fi1260131967.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/1h3fi1260131967.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/2i4071260131967.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/2i4071260131967.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/3w9or1260131967.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/3w9or1260131967.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/4riky1260131967.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/4riky1260131967.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/51r251260131967.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260132157g4t24votr7y8bs6/51r251260131967.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