Home » date » 2009 » Dec » 04 »

ws9: decomposition 3

*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 10:22: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/04/t1259947466269v1fcs9fqls3e.htm/, Retrieved Fri, 04 Dec 2009 18:24:32 +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/t1259947466269v1fcs9fqls3e.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 «
6,3 6,2 6,1 6,3 6,5 6,6 6,5 6,2 6,2 5,9 6,1 6,1 6,1 6,1 6,1 6,4 6,7 6,9 7 7 6,8 6,4 5,9 5,5 5,5 5,6 5,8 5,9 6,1 6,1 6 6 5,9 5,5 5,6 5,4 5,2 5,2 5,2 5,5 5,8 5,8 5,5 5,3 5,1 5,2 5,8 5,8 5,5 5 4,9 5,3 6,1 6,5 6,8 6,6 6,4 6,4 6,6
 
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
16.36.3000
26.26.20033875634969-0.0996892400546821-0.000338756349693864-0.413526898000771
36.16.09976744827461-0.1005625152226950.000232551725384802-0.00363474764207676
46.36.29745305639210.1937710424430220.002546943607903511.21883612320128
56.56.500628282047710.203054049444421-0.0006282820477140860.0384449021976258
66.66.600971713658930.101665299403964-0.000971713658931074-0.419893279294913
76.56.50158266492297-0.0968007826560898-0.00158266492297389-0.821931126823448
86.26.20138698065123-0.2975773150637-0.00138698065122801-0.831499669577698
96.26.19705230530992-0.00810965825599930.002947694690084691.19880674346806
105.95.90319097012336-0.290182783260372-0.00319097012336136-1.16818289178009
116.16.095223949220250.1858252959550120.004776050779746641.9713487220021
126.16.102670126925140.00974249630433024-0.00267012692514542-0.729232584938666
136.16.09961056619894-0.002893737405888620.000389433801055103-0.0523382102394348
146.16.09785093585783-0.001774059100856510.002149064142167700.00464350935965628
156.16.103277349273330.00527074334871684-0.003277349273326070.0292998277865995
166.46.393557792974420.2835247274956230.006442207025580111.15208749848241
176.76.701417048985460.307286599264358-0.001417048985458000.098409103018933
186.96.902393080247150.203474052341428-0.00239308024714992-0.429931209766651
1976.997518426896870.09767194639559920.00248157310312842-0.438170815007838
2077.009322806844280.0138226543213788-0.00932280684427659-0.347255019452226
216.86.79247267854197-0.2114283594101040.00752732145802524-0.932858742203005
226.46.41270405860088-0.375811908003098-0.0127040586008774-0.680781089097793
235.95.89467502498198-0.5146864655985390.00532497501802364-0.575137684607805
245.55.50016070165732-0.397338999364159-0.0001607016573247250.485985066471323
255.55.49399960026595-0.01538730660903110.006000399734044821.58202586966257
265.65.592981409951750.09631440046555870.007018590048252860.463081881057796
275.85.807498165702840.210931531069805-0.007498165702840820.476226005450853
285.95.898435432125450.09470248699096430.00156456787455183-0.481200501660963
296.16.097479475051570.1957742050837940.002520524948426190.41859107594146
306.16.104744150126350.0131619052041264-0.00474415012635025-0.756273520089822
3166.00004468809009-0.101011726964120-4.46880900908772e-05-0.472840848662802
3266.00321778512485-8.70050724529753e-05-0.003217785124854290.417971520913078
335.95.89378461292126-0.1060116073873690.00621538707874165-0.438678120515491
345.55.51396360252218-0.37125323279174-0.0139636025221789-1.09847660896160
355.65.581733068760450.05403306012328950.01826693123955351.76128872590351
365.45.41421378592133-0.160585822070662-0.0142137859213330-0.888827211245181
375.25.19562301857758-0.2167707021329430.0043769814224184-0.232720492953543
385.25.19360557190027-0.00869871652424620.006394428099728340.862275194198476
395.25.201907475520980.0076847069001057-0.00190747552097960.068010706536208
405.55.498504177475760.2860153700027770.001495822524241021.15232777236473
415.85.794699370145120.2958213457386570.005300629854884970.0406118825422641
425.85.805822432232370.0215580799705882-0.00582243223236669-1.13583787026343
435.55.51191357179922-0.282345598274516-0.0119135717992181-1.25859262625289
445.35.30200515969737-0.212563904753882-0.002005159697374160.288995201556250
455.15.07691512668202-0.2246308331879490.0230848733179795-0.0499742023660053
465.25.223093379363630.132584926646026-0.0230933793636331.47938000429862
475.85.767855106963080.529653386848520.03214489303691961.64442727565032
485.85.822501937029280.072064157359714-0.0225019370292789-1.89507026558255
495.55.51027369316912-0.298106915018495-0.010273693169116-1.53330788173242
5054.99125394428652-0.5109495375310440.00874605571347878-0.881785297819474
514.94.89885467575368-0.1092615994303790.001145324246316341.66634087652492
525.35.292384875997850.3733239170326990.007615124002152451.99808449014423
536.16.082275687935190.7730636852389240.01772431206481161.65552840689468
546.56.504812872390760.436667506505551-0.00481287239075659-1.39315722914169
556.86.818672303516170.318809639292635-0.0186723035161743-0.488098869759394
566.66.60604110816872-0.191206426526746-0.00604110816871922-2.11219003005265
576.46.37966157589264-0.2249615088235940.0203384241073565-0.139793928781406
586.46.438704838811880.047593964335382-0.03870483881188121.12876631249156
596.66.557812745953470.1162251892730000.04218725404652950.284230857820430
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947466269v1fcs9fqls3e/1p9mh1259947365.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947466269v1fcs9fqls3e/1p9mh1259947365.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947466269v1fcs9fqls3e/2ypll1259947365.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947466269v1fcs9fqls3e/2ypll1259947365.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947466269v1fcs9fqls3e/383ic1259947365.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947466269v1fcs9fqls3e/383ic1259947365.ps (open in new window)


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


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