Home » date » 2009 » Dec » 09 »

*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: Wed, 09 Dec 2009 09:15:18 -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/09/t1260375367leizxlmqs2ai6ii.htm/, Retrieved Wed, 09 Dec 2009 17:16:13 +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/09/t1260375367leizxlmqs2ai6ii.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 «
153.4 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 265.7 287.6 283.3 295.4 312.3 333.8 347.7 383.2 407.1 413.6 362.7 321.9 239.4 191 159.7 163.4 157.6 166.2 176.7 198.3 226.2 216.2 235.9 226.9
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1153.4153.4000
2145145.876191167459-7.44134377868622-0.041232530240796-0.557950534988849
3137.7137.791193719566-7.99195450904879-0.0398729065246219-0.0397493044432643
4148.3147.0034852156496.86854273510676-0.05655744513024741.05522810977596
5152.2152.3736359823635.57296841526736-0.0563948021853457-0.0916881440644917
6169.4168.62076096854914.8031708653358-0.05595673533716080.653207893605105
7168.6169.7278336700482.96004521014379-0.0562167320232124-0.838115427451734
8161.1161.993016572943-6.28773277779368-0.0562398245501543-0.654446774325278
9174.1172.8173891503238.50894960012367-0.05625339692364091.04713164279455
10179179.2209777440916.68846225306813-0.0562526151651217-0.128832251264188
11190.6190.31180790537010.4951527359973-0.05625280416581980.269391877582786
12190190.8363609517281.87365858787821-0.0562529569762432-0.610125910298412
13181.6182.938653778518-6.48111459570032-0.582679721214916-0.627341256815093
14174.8174.860704709527-7.707929457364860.0323240020032319-0.0840417131388031
15180.5179.5602418125163.07890274373382-0.009631642283819080.749056934503394
16196.8195.81078294120414.4475557326564-0.03378712155713410.80214830106102
17193.8195.0216539271821.27646422051838-0.0299470804210284-0.93208399799127
18197196.9767992090481.86335423195363-0.02990286930926470.0415327406762524
19216.3215.06020688496715.8892024854284-0.02932022427382610.992580120109795
20221.4222.1201743997388.25459899185731-0.0293643167277498-0.540285629075005
21217.9218.832431119834-1.72595515304180-0.0293498305701368-0.706303868245136
22229.7228.8133993084018.39691627123799-0.02935804894539550.716375379228054
23227.4228.1390967597350.5531101339685-0.0293571517537865-0.555090484024443
24204.2206.004465437042-19.0647902955236-0.0293577002260322-1.38831960586255
25196.6195.003051588083-12.14337365850190.9706702683227440.509471571765212
26198.8197.797267133778-0.2898752338866510.05430444443483640.821434943482309
27207.5206.7569900328067.740327776154580.03112566028906030.560382308394789
28190.7192.361294330894-11.37464313852450.0612299935782609-1.34975235316270
29201.6200.0511058275345.106575047340810.05766866367807321.16633561543262
30210.5210.0586242948859.344594827595830.05790528405270040.299914624446646
31223.5223.14892084105912.58355797276660.05800500700961130.22921475523822
32223.8224.6121064933272.967829734917250.0579638471243436-0.680485867963241
33231.2230.8835611176115.824443843794850.0579607741115960.202156870978219
34244243.41711654005211.62575339716970.05795728333142850.410547082700231
35234.7236.122394870615-4.734621674088070.0579586702973887-1.15779104661693
36250.2248.78116741531910.30530085111420.05795898194367831.06434525893544
37265.7265.46122727223215.7876099604038-0.2572890474533760.399569953009538
38287.6287.13998149483520.54945423544460.0679385793545250.331845793567933
39283.3284.9433822354150.8183259956027240.113214930425090-1.38090746670211
40295.4294.6072518026698.458780868521660.1036556398603370.539754905519306
41312.3311.53511214844115.78063270811830.1023988247866560.518150260593486
42333.8333.23428669052820.89855256140380.1026258183503770.362183457773561
43347.7348.07173743876415.65745773502080.102497631958868-0.370901557770521
44383.2381.69201921454231.18980668961420.1025504472700451.09919329085371
45407.1407.42443591913526.4708507761410.102554479910365-0.333951078366074
46413.6414.97757456363910.11287035328230.102562299012752-1.15762158183954
47362.7367.132139880492-40.00318750707620.102565674062501-3.54661325487644
48321.9322.184307513508-44.27878055109050.102565603683433-0.302575174699811
49239.4244.69135337561-72.874940188163-2.70385583171962-2.07189404251916
50191189.435820702217-58.46229896346550.3561394552522891.00769419349876
51159.7157.346170983006-35.59769226639540.3125991882870561.60325199710515
52163.4160.129604881931-2.439417477221930.2781877414660312.34314407498757
53157.6157.348499499636-2.734828968041130.278229801234249-0.0209055951065479
54166.2165.1008849094036.333680666872410.2785634175315380.641758095721906
55176.7176.05949144334710.33288548623130.2786445481387840.28301557516907
56198.3197.17749085622219.65870579971220.2786708508726360.659969664214074
57226.2225.26208614201626.94449738352650.2786656865720930.515600908638063
58216.2218.554304103791-2.154336711160120.278677223600816-2.05926633270578
59235.9234.22655659216413.26016487042510.2786763625596691.09085347013727
60226.9228.135388232967-3.472771041512210.278676134099501-1.18415643272776
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/13lun1260375315.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/13lun1260375315.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/2d7qr1260375315.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/2d7qr1260375315.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/3tlt91260375315.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/3tlt91260375315.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/4bfs61260375315.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260375367leizxlmqs2ai6ii/4bfs61260375315.ps (open in new window)


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