Home » date » 2009 » Dec » 29 »

*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: Tue, 29 Dec 2009 04:03:45 -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/29/t12620846979mzn2rcb95lbrtu.htm/, Retrieved Tue, 29 Dec 2009 12:05:03 +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/29/t12620846979mzn2rcb95lbrtu.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 «
8 8,1 7,7 7,5 7,6 7,8 7,8 7,8 7,5 7,5 7,1 7,5 7,5 7,6 7,7 7,7 7,9 8,1 8,2 8,2 8,2 7,9 7,3 6,9 6,6 6,7 6,9 7 7,1 7,2 7,1 6,9 7 6,8 6,4 6,7 6,6 6,4 6,3 6,2 6,5 6,8 6,8 6,4 6,1 5,8 6,1 7,2 7,3 6,9 6,1 5,8 6,2 7,1 7,7 7,9 7,7 7,4 7,5 8 8,1
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
188000
28.18.09925344826450.0993151467687110.0007465517354943430.312144661532379
37.77.71033729004476-0.378431686426799-0.0103372900447557-1.51214927172144
47.57.49518144618358-0.2195995002138750.004818553816418750.497206469501047
57.67.595433796671540.09169151191777250.004566203328456580.974888938016866
67.87.799975429521850.2015282263063822.45704781487947e-050.343976132170661
77.87.80470550470120.00998749078310632-0.00470550470120262-0.599848918670261
87.87.79990695798508-0.004403528467288259.30420149202435e-05-0.0450684147140476
97.57.50581770169191-0.286350290163513-0.00581770169191252-0.88297384336456
107.57.49414521701395-0.01901051174364940.005854782986050430.837229093239738
117.17.10858667133196-0.37576619516409-0.00858667133196044-1.11725325390524
127.57.4849979740670.3563168411732290.01500202593299872.2926674822242
137.57.508642610382580.032587076773531-0.00864261038258466-1.01407990410654
147.67.584914895627950.07511811827638440.01508510437205100.133567918038366
157.77.70847606058230.121471978101266-0.008476060582299880.146272311098007
167.77.705455245087150.00261434002097083-0.00545524508714855-0.371955138449220
177.97.894644568338850.1807495086629830.005355431661151810.557902812678462
188.18.094896801659980.1993724696067930.005103198340015570.0583215090833516
198.28.212195433902850.121001741196476-0.0121954339028472-0.245434002944632
208.28.1909994410428-0.01477913545992260.009000558957195-0.425225530166752
218.28.218524732807320.0256162848724262-0.01852473280731690.126506505635344
227.97.88249894272392-0.3197066251738620.0175010572760754-1.08144919353469
237.37.33869729193712-0.533690185774264-0.0386972919371166-0.670133269467272
246.96.87140224212641-0.4702915195747830.0285977578735890.198546043256021
256.66.60311922778425-0.277433260941253-0.003119227784245170.604149594912838
266.76.67977104501360.06080089774037620.02022895498639731.06092958645746
276.96.895147381174450.2067845357590220.00485261882554620.459307752845182
2877.017674990043840.127210418477692-0.0176749900438427-0.249046153952195
297.17.098847932207020.08375092936435120.00115206779297903-0.136111223030652
307.27.193187218257690.09374822462732580.006812781742310.0313085411199649
317.17.1100720075795-0.07324315511923-0.0100720075795037-0.52296789058124
326.96.9055879594375-0.197156910422666-0.00558795943749705-0.38806121776312
3376.996421757121620.07475490741420690.003578242878375120.85154738176011
346.86.78424673668332-0.1961560105141880.0157532633166833-0.848412853688194
356.46.44173983614233-0.334337351626327-0.041739836142333-0.432743423377657
366.76.649641510522860.1776180780971790.05035848947714311.60329587906902
376.66.62624203274371-0.0121423223956272-0.0262420327437118-0.594487171643204
386.46.39927632215368-0.2150234991505260.000723677846320193-0.635800922086482
396.36.28504196179206-0.1205124294447350.01495803820794470.296796859166133
406.26.21239006778479-0.0755941333569787-0.01239006778478910.140618085687078
416.56.491613116567420.257180476541750.00838688343258281.04216848423040
426.86.78624811654730.2923152797185600.01375188345270530.110032561872672
436.86.806394989368650.0369978373522829-0.0063949893686552-0.799578495942069
446.46.44677828751598-0.335055756823133-0.0467782875159820-1.16516196744487
456.16.08224180870059-0.3627106902962170.0177581912994072-0.0866070734016949
465.85.75679966834911-0.3277500610180430.04320033165089390.109486350054354
476.16.149117304733860.347731453096235-0.04911730473386282.11541274740739
487.27.123165010166080.935235838832270.0768349898339191.83989654065104
497.37.346626789234730.267642099046376-0.0466267892347286-2.09154344595480
506.96.93040979468902-0.373894943904836-0.0304097946890245-2.00952585364868
516.16.09048338595636-0.8091209698275830.00951661404364303-1.36527912941267
525.85.80665831083743-0.31803189808199-0.006658310837431581.53770947365362
536.26.174445596474320.3226600834973550.02555440352567742.0063694962774
547.17.062533993775840.8509755419066160.03746600622416081.65455577486633
557.77.699469564893580.6509764804968680.00053043510642342-0.626336834773619
567.97.961492096631430.287541529634192-0.0614920966314265-1.13817113772244
577.77.68002448200592-0.2441312206566490.0199755179940838-1.66504180735822
587.47.38064957142924-0.2957503530718080.0193504285707568-0.161655880159988
597.57.587454513122570.173834195968218-0.08745451312257181.47060399206747
6087.898961325207570.3024652007813830.1010386747924260.402838373145633
618.18.123418712124480.229583418603231-0.0234187121244858-0.228334511141484
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/1kw1j1262084620.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/1kw1j1262084620.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/2z0un1262084620.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/2z0un1262084620.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/3avih1262084620.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/3avih1262084620.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/45ufx1262084620.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/45ufx1262084620.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/5401g1262084620.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/29/t12620846979mzn2rcb95lbrtu/5401g1262084620.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