Home » date » 2009 » Dec » 01 »

*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, 01 Dec 2009 14:20:48 -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/01/t12597025191munz8zvuete3fx.htm/, Retrieved Tue, 01 Dec 2009 22:22:06 +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/01/t12597025191munz8zvuete3fx.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 «
111.4 87.4 96.8 114.1 110.3 103.9 101.6 94.6 95.9 104.7 102.8 98.1 113.9 80.9 95.7 113.2 105.9 108.8 102.3 99 100.7 115.5 100.7 109.9 114.6 85.4 100.5 114.8 116.5 112.9 102 106 105.3 118.8 106.1 109.3 117.2 92.5 104.2 112.5 122.4 113.3 100 110.7 112.8 109.8 117.3 109.1 115.9 96 99.8 116.8 115.7 99.4 94.3 91 93.2 103.1 94.1 91.8 102.7
 
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
1111.4111.4000
287.499.8959539316997-0.224183712393462-12.4959539316997-3.77471157315384
396.894.339309268493-0.5691313486212912.46069073150694-1.33271605733773
4114.1101.723564933706-0.098844172443867112.37643506629432.46831244139248
5110.3106.8598040531410.1168198116410483.440195946859471.83558024291616
6103.9107.0639709058570.119137784906014-3.163970905857390.0316988220915472
7101.6104.9481280284680.0773151079021414-3.348128028468-0.816544568468068
894.6100.2320158626470.0016220913592343-5.63201586264684-1.75189481224714
995.997.1668014595735-0.0452188529674338-1.26680145957346-1.11964241708753
10104.799.2958365156745-0.01148255395967515.40416348432550.792862361470975
11102.8101.2969362223310.02024592370175741.503063777669110.733381500474781
1298.1100.5911117035020.0087643243230906-2.49111170350176-0.264507486948939
13113.9102.814221941408-0.031859351006600111.08577805859170.849107270893794
1480.999.7935477949431-0.0117124586909016-18.8935477949431-1.13177845328493
1595.798.987425219725-0.024086084943073-3.28742521972501-0.273720806017243
16113.2100.8215939021150.025779952872058912.37840609788480.623623446985644
17105.9101.6098553417320.04701671455320734.290144658267970.263729185843117
18108.8104.7283030640010.1197651901511014.07169693599881.09584152464600
19102.3104.4854086960340.112983400460035-2.18540869603425-0.131478232683559
2099104.0421839232850.104658715053347-5.04218392328478-0.20288370454963
21100.7103.8462939456300.100876708529739-3.14629394563046-0.109821794033034
22115.5106.6512324741460.1296542557741778.848767525854270.987908168694762
23100.7104.4892103836210.111252194241004-3.78921038362127-0.83656361546845
24109.9107.2286680105390.1224076582332332.671331989460940.960554293568703
25114.6105.8840175598370.1213360147397358.71598244016299-0.539045021946316
2685.4105.1226144615170.118582981810548-19.7226144615167-0.321690397564941
27100.5105.1431535372530.117625156977526-4.64315353725302-0.0348528561178327
28114.8104.6203650456590.10749628911827710.1796349543411-0.223986585483039
29116.5108.1435116358260.1713371164204788.356488364173521.19974494886135
30112.9109.1049141310690.1859302987293793.795085868931280.281552001571018
31102107.4028683969620.154943985213279-5.40286839696195-0.68149192715483
32106108.6041715703260.169321676514080-2.604171570325710.380494672759458
33105.3109.3648089448870.175880164664117-4.064808944886550.215661624190514
34118.8109.5079228057530.1755987254688919.29207719424673-0.0119566864945872
35106.1110.1582442897590.178568838772146-4.058244289759290.173204522851695
36109.3108.5883506293170.1708177464502120.711649370683478-0.637986259099148
37117.2108.0491123178660.1680398041639929.15088768213435-0.258756733401266
3892.5109.6600933897870.175858398132718-17.16009338978670.522480712336001
39104.2110.0491798819870.177665422541725-5.849179881986590.0763843959498218
40112.5108.0430116230970.1521695233502194.45698837690309-0.776126929599112
41122.4109.9858556106960.17685838603247712.41414438930390.636497263966404
42113.3110.0230779762870.1748557519045143.27692202371337-0.0499614453383717
43100108.6456036491940.153848165145766-8.64560364919415-0.559863637242873
44110.7110.3051012370870.1717079411637540.3948987629128720.546220229590452
45112.8113.2170600170350.198633909638723-0.417060017034550.997129139653574
46109.8109.0302967985220.1644032779779210.769703201477491-1.59748156769750
47117.3112.3701389773430.1838201123201234.929861022656741.15692001427661
48109.1111.7068753139380.179516311244377-2.60687531393763-0.308471097693046
49115.9110.0118608558660.1701297008511685.88813914413376-0.681263823932619
5096110.7677334143400.173635599652390-14.76773341434010.211947954752422
5199.8108.7192737712450.156503024925510-8.91927377124538-0.799428676081407
52116.8110.0676929607090.1679110136486726.732307039290650.426988954180712
53115.7107.7289510547220.1404470582802787.97104894527806-0.897619062052119
5499.4102.6959742726640.0809280947449408-3.29597427266353-1.85854962906632
5594.3102.2569676926200.0751193400567024-7.95696769261977-0.187663958651076
569198.12062887928110.0323539467074631-7.12062887928114-1.52625463107751
5793.294.82116286780340.00315485374652326-1.62116286780336-1.21053837022496
58103.197.56718348138050.02325899388687395.53281651861950.997738158170022
5994.194.64541192962820.00513789010988046-0.545411929628159-1.07157936364149
6091.893.409164439378-0.00166425573088006-1.60916443937796-0.451452290412623
61102.794.3173880154580.003299044174055258.382611984541950.330353121774033
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/1xjww1259702445.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/1xjww1259702445.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/2eolv1259702445.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/2eolv1259702445.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/3icom1259702445.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/3icom1259702445.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/44xfg1259702445.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/44xfg1259702445.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/5jtsx1259702445.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t12597025191munz8zvuete3fx/5jtsx1259702445.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
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