Home » date » 2010 » Dec » 20 »

Paper 'Decomposition by 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: Mon, 20 Dec 2010 18:19:34 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al.htm/, Retrieved Mon, 20 Dec 2010 19:24:07 +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/2010/Dec/20/t129286944608sym98effrk3al.htm/},
    year = {2010},
}
@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 = {2010},
    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 «
9,3 14,2 17,3 23 16,3 18,4 14,2 9,1 5,9 7,2 6,8 8 14,3 14,6 17,5 17,2 17,2 14,1 10,4 6,8 4,1 6,5 6,1 6,3 9,3 16,4 16,1 18 17,6 14 10,5 6,9 2,8 0,7 3,6 6,7 12,5 14,4 16,5 18,7 19,4 15,8 11,3 9,7 2,9 0,1 2,5 6,7 10,3 11,2 17,4 20,5 17 14,2 10,6 6,1
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
19.39.3000
214.213.47365057043154.105288274699640.03418114894682841.68788817435418
317.317.29543077026913.873819021173380.0348488777500524-0.0892422670501881
42322.79534458024165.214233204647570.03228772364482820.509928115872817
516.317.3813385696288-3.567016126640880.0357082875956243-3.31928107716536
618.417.9315460214604-0.1645857100111230.03586518804804321.28582435110197
714.214.5068164740025-2.858752948131510.0357222557140473-1.01816048760667
89.19.30995685826204-4.790893318840820.0356951289081438-0.730177046530401
95.95.73640706114873-3.784929500942690.03569495971004480.380164645625416
107.26.668704157023670.1131932278480890.03568952871622961.47314289402519
116.86.76598252994090.1000418339144350.0356895348691232-0.00497005451087878
1287.859891625672890.9213339326027840.03568951021838930.310375198168052
1314.313.44858678752584.721092642489520.3683126630528711.54882453246819
1414.614.92591100026432.36626378775062-0.0829124914284717-0.849590760451241
1517.517.55637960649352.58599970783584-0.08371738498382320.0817094097148589
1617.217.54704068950960.445429657382742-0.0772596839675676-0.804872088726869
1717.217.3448569191145-0.0893560378111895-0.0768856075502051-0.202078262502383
1814.114.4696843140624-2.39153556761987-0.076987354812468-0.870014716606215
1910.410.6293139453037-3.58887668960232-0.0770853519865376-0.452486321982249
206.86.89261888343265-3.71103030858513-0.0770883107293593-0.0461631695082386
214.14.08244132690474-2.96660127030685-0.07708784158412440.281327813754573
226.56.057871636990641.11728876114332-0.07709635234685331.54334636353314
236.16.271986082300610.370942145418384-0.0770957674776677-0.282052486648814
246.36.402369607646060.172154143899226-0.0770957527653614-0.0751241433633196
259.38.133742908929331.448920228739461.003929273897070.505961325380028
2616.415.89561892518276.21046591975929-0.02217725318437991.74806730522154
2716.116.67471506203981.70140703799051-0.0102881228118466-1.68436453918366
281818.04429073615961.42757350727018-0.0096937841099987-0.103109984803715
2917.617.78598757593730.0351368718206689-0.0089932503773615-0.526173742409441
301414.3715194464186-2.81556075867516-0.00908386898046829-1.07730608851385
3110.510.6086605345717-3.59840861191378-0.00912995371442475-0.295845814747527
326.96.9187453757653-3.67402704265202-0.0091312710992513-0.0285770217426683
332.82.85054458620149-3.99975656934779-0.00913141874720444-0.123096723630126
340.70.532452665627751-2.61009794370234-0.009133501733755780.525167076433802
353.63.068468963387591.64244287730242-0.00913589863832161.6070813318533
366.76.519156075749733.13670346047928-0.009135978181237610.564697292667568
3712.511.98797237362245.051238237234460.268614054822960.748990162653571
3814.414.6549919886343.21514326380093-0.0447757597081732-0.679503046031239
3916.516.66795454162932.21811792558843-0.042722230881625-0.373391843239497
4018.718.7561128981192.11084037350763-0.0425404037489694-0.0404267496904691
4119.419.57751709366691.04572260756571-0.0421220121994161-0.402493778657041
4215.816.2967721221645-2.52957745133131-0.0422107515905544-1.35114128314369
4311.311.5728472303135-4.34296811262106-0.0422941022549466-0.685298410837876
449.79.50340232652044-2.46419852582633-0.04226854604650630.710007341384477
452.93.33178318700323-5.52786340039032-0.0422696303466105-1.15779220910008
460.1-0.080045471502183-3.77925868818571-0.04227167682841120.660816698464737
472.51.933647965220731.00780330553977-0.04227378356001211.80908268460161
486.76.380913078681923.8500367587607-0.04227390169344591.07411087077608
4910.39.8898649784963.569622245573720.44578686329263-0.108894999055899
5011.211.43896864571231.99312776352447-0.0546679883545291-0.586108574789652
5117.417.07926133594965.01593203915044-0.05977602290651251.13390686985301
5220.520.70366172981223.86704357078673-0.0581786994249454-0.433170802112864
531717.7704874323238-1.75056447306111-0.0563687912403605-2.12284350851554
5414.214.4240643259263-3.06934250130558-0.0563956384633632-0.498379497522009
5510.610.7228080853074-3.59154720066411-0.0564153255901948-0.197346445341313
566.16.24910627036739-4.32053114938478-0.0564234588509501-0.275490921870606
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/122ze1292869170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/122ze1292869170.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/2cbhh1292869170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/2cbhh1292869170.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/3nkyj1292869170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/3nkyj1292869170.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/4nkyj1292869170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/4nkyj1292869170.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/5gtxm1292869170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t129286944608sym98effrk3al/5gtxm1292869170.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
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time')
grid()
dev.off()
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='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