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 02:37:55 -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/t1259919630zljwdzhpi6pe0mt.htm/, Retrieved Fri, 04 Dec 2009 10:40:36 +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/t1259919630zljwdzhpi6pe0mt.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:
ws9.2st
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2756.76 2849.27 2921.44 2981.85 3080.58 3106.22 3119.31 3061.26 3097.31 3161.69 3257.16 3277.01 3295.32 3363.99 3494.17 3667.03 3813.06 3917.96 3895.51 3801.06 3570.12 3701.61 3862.27 3970.1 4138.52 4199.75 4290.89 4443.91 4502.64 4356.98 4591.27 4696.96 4621.4 4562.84 4202.52 4296.49 4435.23 4105.18 4116.68 3844.49 3720.98 3674.4 3857.62 3801.06 3504.37 3032.6 3047.03 2962.34 2197.82 2014.45 1862.83 1905.41 1810.99 1670.07 1864.44 2052.02 2029.6 2070.83 2293.41 2443.27
 
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
12756.762756.76000
22849.272844.556143255116.572769511994324.713856744892530.334856114850539
32921.442916.6710789275613.75894559777004.76892107243610.397644653822629
42981.852977.0476895248520.63388371132084.802310475148860.276723980078269
53080.583075.731520114134.222955322484.848479885897330.455956242881725
63106.223101.3756211009632.5768688395724.84437889903677-0.0495684161884733
73119.313114.4730397261828.61644058056934.83696027381733-0.111740821245485
83061.263056.44909034310.37844032343884.810909657-0.494707706596145
93097.313092.4930321658615.89536591896404.816967834144680.14612296011944
103161.693156.8640806475726.44789097363994.825919352433790.275492913068759
113257.163252.3241322573441.58594989769094.835867742663470.3917681298115
123277.013272.1765748309336.79661922083814.83342516906696-0.123292234285078
133295.323336.9621758588242.7274960267156-41.64217585881830.185097043221914
143363.993360.632958087438.66116707367433.35704191260091-0.0909000087708877
153494.173490.8917890527158.97367656412143.278210947288940.518584323520462
163667.033663.8281162264484.24904896926483.201883773558240.645333722884836
173813.063809.8903330491197.95989198067883.16966695089370.350081949503154
183917.963914.7931489521199.50005204133033.166851047886750.0393262718754584
193895.513892.3046491486572.43707319847093.20535085134800-0.69103396764026
203801.063797.813654674435.40204648274253.24634532560158-0.945672202688552
213570.123566.82274866132-23.70339835856313.2972513386771-1.50923883675795
223701.613698.3358283372310.73632588840453.274171662770040.879410554312389
233862.273859.0131765212644.00655796916423.256823478736490.849549644226362
243970.13966.8489228637558.16988706002423.251077136249120.361658634020461
254138.524149.9673846995885.4874292632685-11.44738469958120.76665883299017
264199.754199.2324408707677.65711086422640.51755912923884-0.185278196338789
274290.894290.3805632852580.65305331702650.5094367147527250.0763872412502124
284443.914443.4344833125696.72496030198990.4755166874429930.410024742494637
294502.644502.1506281882688.28932292957740.489371811736392-0.215285665396504
304356.984356.4242541751136.35770993259290.555745824886518-1.32563082550640
314591.274590.7579458739180.289317102630.5120541260871651.12156519386773
324696.964696.4523084421685.92667775097780.5076915578437990.143932062087999
334621.44620.8707283505850.08824949952610.529271649422923-0.91506395027393
344562.844562.299431374825.97676295811730.54056862519734-0.615657321927685
354202.524201.94817883528-59.74984926552330.571821164718137-2.18896256318707
364296.494295.92785537591-25.63680247031550.5621446240902860.871059436870004
374435.234422.085979865767.727539426020113.14402013424180.907704831720602
384105.184109.78394232916-61.929438299715-4.60394232915507-1.68562661103423
394116.684121.31681963735-45.6185323795723-4.636819637353890.416033667024512
403844.493849.04789353429-95.9275693601094-4.55789353428539-1.28377041015625
413720.983725.53041818677-102.050680568908-4.55041818677158-0.156289252734622
423674.43678.96211488358-89.7383050460216-4.562114883576170.314317681527007
433857.623862.22689729918-29.1571448128794-4.606897299180871.54670297320979
443801.063805.66339925824-35.2386997959309-4.60339925823721-0.155277891589227
453504.373508.94743107151-93.2611460507691-4.57743107151422-1.48151671004765
463032.63037.14817938195-177.259938429254-4.54817938194637-2.14483044050196
473047.033051.58970594275-134.720540862608-4.559705942751141.08621788741837
482962.342966.90204673031-123.617953506867-4.562046730310380.283500128762141
492197.822207.76348024009-263.650756326525-9.94348024009174-3.75065326528572
502014.452012.96501405620-248.6036855592121.484985943802900.368587950599816
511862.831861.37949323273-227.0649873474001.450506767271450.549502112016056
521905.411904.03409089213-167.1989639981721.375909107865661.52785457454302
531810.991809.62975592235-151.0437186113701.360244077646410.412388934231326
541670.071668.71145132100-148.7967391786561.358548678997110.0573651508928167
551864.441863.12616616894-72.63536683870491.313833831056211.94454261168317
562052.022050.73254766379-14.88633896865011.287452336212471.47451012825262
572029.62028.31195337778-16.55822633454661.28804662222115-0.0426896344201635
582070.832069.54550031604-3.733923405341911.284499683958410.327458793443655
592293.412292.1363084694646.48896880572771.273691530535391.28241659775575
602443.272442.0001496588769.42862464558431.269850341130020.585756406119439
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259919630zljwdzhpi6pe0mt/19ln31259919471.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259919630zljwdzhpi6pe0mt/19ln31259919471.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259919630zljwdzhpi6pe0mt/20cuq1259919471.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259919630zljwdzhpi6pe0mt/20cuq1259919471.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259919630zljwdzhpi6pe0mt/399s81259919471.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259919630zljwdzhpi6pe0mt/399s81259919471.ps (open in new window)


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


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