Home » date » 2009 » Dec » 03 »

*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: Thu, 03 Dec 2009 10:39:51 -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/03/t1259862056lm289erx5ptthsi.htm/, Retrieved Thu, 03 Dec 2009 18:41: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/03/t1259862056lm289erx5ptthsi.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 «
115.6 111.9 107 107.1 100.6 99.2 108.4 103 99.8 115 90.8 95.9 114.4 108.2 112.6 109.1 105 105 118.5 103.7 112.5 116.6 96.6 101.9 116.5 119.3 115.4 108.5 111.5 108.8 121.8 109.6 112.2 119.6 104.1 105.3 115 124.1 116.8 107.5 115.6 116.2 116.3 119 111.9 118.6 106.9 103.2 118.6 118.7 102.8 100.6 94.9 94.5 102.9 95.3 92.5 102.7 91.5 89.5
 
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'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1115.6115.6000
2111.9113.687741698322-0.0471880947713023-1.78774169832153-0.694616887019448
3107109.650650696342-0.300420268999158-2.65065069634248-1.17986137036417
4107.1107.814489771174-0.385595156621494-0.714489771174473-0.566908339019792
5100.6104.419200030583-0.496982609736158-3.81920003058255-1.23743256303235
699.2101.419839936339-0.555269108731592-2.21983993633902-1.05663906033247
7108.4103.566241016991-0.5103825257635024.833758983008891.14565084555901
8103103.965582784848-0.497212433639811-0.965582784848050.385656753962141
999.8102.390220127020-0.512656541279543-2.59022012702034-0.456517879969998
10115107.274609641902-0.4335473393926177.725390358097932.28293493881863
1190.8101.772904482027-0.508966894946389-10.9729044820271-2.14266125805436
1295.997.8872412315243-0.559236776159608-1.98724123152428-1.42734437175178
13114.4101.586003629562-0.64449499104738712.81399637043791.89998440734161
14108.2104.014112406986-0.6637328438335764.185887593013891.34566828907464
15112.6108.473969780654-0.5797237998376164.126030219345772.03765011748638
16109.1109.091962759106-0.5478029283863140.008037240894005930.467741863725307
17105108.696170420485-0.543763716981717-3.696170420485330.0614092171368355
18105108.610425413051-0.533763963761378-3.610425413050610.190500847750431
19118.5110.708530927764-0.4893427936529317.791469072236351.10937591968876
20103.7108.723510441766-0.509550736680363-5.02351044176596-0.633337479110186
21112.5111.240773259540-0.4745497971530291.259226740459841.28309305009180
22116.6109.208001436983-0.4900836080454647.39199856301667-0.66028082431665
2396.6107.514220213086-0.499127164182574-10.9142202130862-0.509582683146522
24101.9106.906780162968-0.499520615158058-5.00678016296778-0.04591202920547
25116.5106.616023582576-0.4995420337053909.883976417423830.0890426185936181
26119.3111.167437954341-0.4859615943621358.132562045659312.13501455937932
27115.4112.460169168803-0.4685260066644142.939830831197350.732356600130681
28108.5111.149181881861-0.481860703171466-2.64918188186052-0.34176275406857
29111.5112.735400796103-0.444007120938674-1.235400796102520.844620551513454
30108.8113.365961531754-0.425049793984041-4.565961531753620.445604412221594
31121.8113.468199095062-0.4169572885873228.331800904938080.221313615354056
32109.6114.228788658551-0.40201038768555-4.628788658550790.497382907054865
33112.2112.356940498885-0.417020417771914-0.156940498884516-0.622230937044485
34119.6111.394492866566-0.4213213085861758.2055071334341-0.230922661251823
35104.1112.604607148882-0.412128282963062-8.504607148881870.690472793856605
36105.3112.430824121390-0.411222634577728-7.130824121389770.100889960881476
37115110.706514287640-0.4155474786204624.29348571235951-0.555210311432967
38124.1112.716362589507-0.40346227407031911.38363741049341.01863608328307
39116.8113.573622595872-0.3930154511588363.22637740412750.523525100593334
40107.5112.883286111940-0.396463177848309-5.38328611194034-0.122521932774575
41115.6114.524937754335-0.368714054443211.075062245665420.840941179444782
42116.2117.417426362713-0.323190776880803-1.217426362712771.35571372482436
43116.3114.219682076951-0.3604244450392312.08031792304885-1.20471851411286
44119116.731999858988-0.3283164346070792.268000141011631.21057249830677
45111.9115.315896545428-0.33824442662793-3.41589654542791-0.459554304134722
46118.6113.269026546096-0.3504322784366245.33097345390403-0.722327441597483
47106.9113.543308157550-0.347016451361964-6.64330815755040.264088344838222
48103.2112.195956954700-0.351478738505313-8.99595695469985-0.422650512881255
49118.6113.340949444540-0.3448076235230815.259050555459630.630972541030574
50118.7111.444858783450-0.3534590979994747.2551412165505-0.65103651598311
51102.8106.394057355863-0.388552057390045-3.5940573558635-1.95933030901455
52100.6105.77669223239-0.390713289251661-5.17669223239005-0.095040005492601
5394.9101.307677568354-0.434911326123989-6.40767756835446-1.69421194787425
5494.597.5523946791226-0.472422598881949-3.05239467912265-1.38471498365671
55102.998.448287977431-0.4575983873950814.451712022568970.573525871408617
5695.395.9559531014323-0.477327684353014-0.655953101432312-0.856299223544018
5792.594.9026439899448-0.482063745010377-2.40264398994485-0.242951611824349
58102.795.5966404765-0.4741320882503577.103359523499960.496520236397815
5991.596.4089929797308-0.466983318817869-4.908992979730840.543191702966212
6089.597.2059100330946-0.46077845252541-7.705910033094570.533312661209458
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/10ku41259861988.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/10ku41259861988.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/2pii41259861988.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/2pii41259861988.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/32itg1259861988.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/32itg1259861988.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/40r8n1259861988.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/40r8n1259861988.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/52pst1259861988.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862056lm289erx5ptthsi/52pst1259861988.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