Home » date » 2009 » Dec » 04 »

WS9

*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 13:18:41 -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/t12599580125otdf9e2q0azfa9.htm/, Retrieved Fri, 04 Dec 2009 21:20:18 +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/t12599580125otdf9e2q0azfa9.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 «
14,3 14,2 15,9 15,3 15,5 15,1 15 12,1 15,8 16,9 15,1 13,7 14,8 14,7 16 15,4 15 15,5 15,1 11,7 16,3 16,7 15 14,9 14,6 15,3 17,9 16,4 15,4 17,9 15,9 13,9 17,8 17,9 17,4 16,7 16 16,6 19,1 17,8 17,2 18,6 16,3 15,1 19,2 17,7 19,1 18 17,5 17,8 21,1 17,2 19,4 19,8 17,6 16,2 19,5 19,9 20 17,3
 
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
114.314.3000
214.214.29500774683440.0016661721550155-0.0780265031164082-0.135206814530930
315.914.71161310786780.04905815315998380.9919091412544421.81090677204527
415.315.07550087883080.08686003947674770.1181975208014801.11331515010707
515.515.31003185104660.1029130730841100.1335308145464560.589314249027969
615.115.35632750758300.0975760865211123-0.230424389718164-0.261606018765814
71515.31967470233970.0867515390937438-0.249454491585662-0.68982583395243
812.114.67505705026350.0360034328797377-2.15769139885873-4.02461137081414
915.814.67034397419720.03352912481363881.15418490005985-0.233744802012717
1016.915.10718565246210.05548306836771461.541570029852122.37637421446372
1115.115.28485089321900.061573077470008-0.2625711624293530.731624844678089
1213.715.0670354576870.0485841922323457-1.18693530095794-1.69016311865968
1314.815.04189263112700.0483022663226904-0.188765019917626-0.506042089126555
1414.715.10302785306810.0484603741658385-0.4118689384394420.0844505345182671
151615.17667781352910.04920833610939190.8078725972132150.150091107778446
1615.415.24824629142350.05012261341861810.139121677906730.125101567369744
171515.17832956320880.0446357383812894-0.112223283305054-0.662065917375712
1815.515.20701735128030.04389680340825720.301871067890596-0.0892618039525464
1915.115.16061797303180.0398709689973782-0.00892349253284508-0.518005837561388
2011.714.95224939247440.0295240195103816-3.10606746351644-1.45888694819494
2116.314.99464677877210.03001730152367851.297587230281160.0771677660447492
2216.715.04771895518460.03081876632780441.638104656171100.140291329473701
231515.06904574842970.0305249247535039-0.0631196386936098-0.0584266714262434
2414.915.25848896633500.0347497255643355-0.4590899322243380.98853549968283
2514.615.25907951414420.0340283265649276-0.63708080911465-0.215639816957508
2615.315.35058543516630.0352321631711392-0.08739365921308960.360837901617910
2717.915.69526802757380.04265833005393712.011183066933641.90381119753072
2816.415.90908596344080.04736603627144030.386473660393741.03256540511006
2915.415.91333132141780.0460712169734231-0.48739942557148-0.257517508509476
3017.916.20762293543610.05381921695450171.543489629299481.48215975139601
3115.916.24326913933720.053251914131949-0.332304975172251-0.109196623808679
3213.916.42490156542220.0571470498617714-2.603119324349090.778266781918136
3317.816.53958639292380.05880894372948891.224986050803230.35191211740369
3417.916.57567353382090.05819349282756641.33845175324218-0.140042297330697
3517.416.80877844778880.06259182831032380.4816069149198021.08478235226376
3616.717.00309530455430.0656582305251482-0.3861726793680810.820927596171908
371617.09021173539230.0661268667354803-1.103799138405980.134125794935218
3816.617.15638207835110.0661278025753503-0.5564095692173550.000271328430303025
3919.117.23981220838800.06651160688128481.849315553254800.107395871153424
4017.817.35248172261940.06758515966034640.4187383559867280.284717613202098
4117.217.53169465228210.0702922184361049-0.4008928403593180.685651408141149
4218.617.55813624220920.06920165036727481.06898720970759-0.269051621832577
4316.317.46949751284570.0652520213595037-1.07174745728954-0.97004230462107
4415.117.532854741320.0652051385182-2.43167721929837-0.0116829235977194
4519.217.68382359498860.06727456087947621.462640821898090.530821575783378
4617.717.57878073520370.06325801109049040.2292646579917-1.07041315944125
4719.117.78008399752380.06635314537315341.233022378537070.860146087810786
481817.99286784564360.0695181798509990-0.08531008036747190.91443624558341
4917.518.21114269188970.0726485578419924-0.8051995070716020.929980344330664
5017.818.35596787149860.0741523140731951-0.6015925229628330.451050971789584
5121.118.60926358462170.07790772501598752.377705516723871.11768105353519
5217.218.42136934259080.0722486600696717-1.05408961133033-1.65490189898993
5319.418.61436145654110.07486261932601830.7098146120910210.75054699514837
5419.818.71544420167360.07543700682538581.068107391953920.162888033306992
5517.618.78613700839150.0753326760074915-1.18316011444552-0.0294863541080765
5616.218.83322033021730.0747143352158588-2.61547145295293-0.175796358356960
5719.518.74606657365530.07121370088358890.855825510628639-1.00895861596640
5819.918.95908572965780.07422841718130150.8514697329359280.885385781614835
592019.07731909882470.07514622229758070.8948734045415860.275155117591189
6017.318.89415479157060.0698533142828176-1.43069437521422-1.61691627781329
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/1pldg1259957917.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/1pldg1259957917.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/2dw9l1259957917.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/2dw9l1259957917.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/358ih1259957917.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/358ih1259957917.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/544k21259957917.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599580125otdf9e2q0azfa9/544k21259957917.ps (open in new window)


 
Parameters (Session):
par1 = 0.2 ; par2 = 1 ; par3 = 1 ; par4 = 12 ;
 
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 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