Home » date » 2009 » Dec » 06 »

WS9

*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: Sun, 06 Dec 2009 08:13:07 -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/06/t1260112435zt73r4i51ttopcz.htm/, Retrieved Sun, 06 Dec 2009 16:14:02 +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/06/t1260112435zt73r4i51ttopcz.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 «
10414,9 12476,8 12384,6 12266,7 12919,9 11497,3 12142 13919,4 12656,8 12034,1 13199,7 10881,3 11301,2 13643,9 12517 13981,1 14275,7 13435 13565,7 16216,3 12970 14079,9 14235 12213,4 12581 14130,4 14210,8 14378,5 13142,8 13714,7 13621,9 15379,8 13306,3 14391,2 14909,9 14025,4 12951,2 14344,3 16093,4 15413,6 14705,7 15972,8 16241,4 16626,4 17136,2 15622,9 18003,9 16136,1 14423,7 16789,4 16782,2 14133,8 12607 12004,5 12175,4 13268 12299,3 11800,6 13873,3 12269,6
 
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
110414.910414.9000
212476.811986.714315715872.5907689086392490.0856842842261.88245541158710
312384.612380.823944324688.35663536594893.776055675442020.477124864408427
412266.712339.915337674784.8151765382335-73.2153376746813-0.223696855269900
512919.912644.253930193387.901746369392275.6460698067410.387151487804389
611497.311992.210189924580.275256871552-494.910189924496-1.30430890953452
71214211941.597905408478.899919702437200.402094591628-0.230417083179349
813919.413068.488958231990.8541930763192850.9110417681021.84310385129774
912656.812986.508843667488.7717232752276-329.708843667419-0.303787261758424
1012034.112382.273631185180.1613984544392-348.173631185062-1.21762916846940
1113199.712732.659747135283.5895961605094467.0402528648300.47463707088919
1210881.311673.167730607268.8171446801262-791.867730607161-2.00710807886463
1311301.211845.090758469966.231334918307-543.8907584699130.197176874366809
1413643.912708.077564580972.3358651041639935.8224354190671.38177730067491
151251712741.004216636171.3305927723695-224.004216636068-0.0638419287637921
1613981.113533.676468729689.53097523124447.4235312703691.22053362873885
1714275.713752.149780594591.9948813251609523.550219405510.224593727141872
181343513938.645451449093.3697424019842-503.6454514489630.165577341149965
1913565.713924.797370132691.9965374392374-359.097370132605-0.187841860858894
2016216.314701.0829616665100.7593592143571515.217038333491.19798727220817
211297013927.111373034289.0286972613423-957.111373034246-1.53061688811245
2214079.914125.293305609690.5226842878062-45.39330560958340.190925715701640
231423513703.074878459384.1538649568585531.925121540712-0.895830588701286
2412213.413329.353563492280.3432287081576-1115.95356349221-0.800748573406247
251258113385.506611132380.2682096002647-804.506611132293-0.0430312598770271
2614130.413349.483878182579.0380971620759780.916121817504-0.202217411286757
2714210.814169.688464344093.353215728640641.11153565597951.24768770824706
2814378.514204.849555746592.0660325364289173.650444253494-0.0987037239538626
2913142.813396.474871522473.6069523699097-253.674871522432-1.55528192363082
3013714.713804.033423737579.5750058156826-89.33342373750370.581671395862051
3113621.914104.301620432383.135461377311-482.4016204323380.385061806367694
3215379.813837.988627256377.72823704352521541.81137274374-0.609634025418624
3313306.314057.39338263479.8944191666793-751.0933826340060.247031098944685
3414391.214162.376264371380.2658792324204228.8237356286610.043700264628799
3514909.914201.523493423379.7120937970591708.376506576667-0.0715417360164041
3614025.414746.522663946085.101425860396-721.122663945960.810877852226727
3712951.214325.987849703879.5118819278745-1374.78784970377-0.884126284977143
3814344.314045.076344067874.3961269745379299.22365593219-0.623801523786547
3916093.415076.173763751392.00444584841281017.226236248721.63101952750475
4015413.615123.153866418491.0729228982325290.446133581597-0.076764230726259
4114705.715158.317183641189.9184089430259-452.617183641073-0.0962566641610976
4215972.815719.938114166899.0908809869327252.8618858331720.818087098189793
4316241.416295.4495183719107.76611090318-54.04951837188940.828436312909904
4416626.415768.689538478296.7491641021483857.710461521787-1.10354942394755
4517136.216911.7955241907114.280870189783224.4044758092681.81838504209820
4615622.916268.3266729907102.110495617744-645.426672990685-1.31530223531364
4718003.916858.9634181646109.5193834284501144.936581835400.847482504137743
4816136.116829.3958356651107.508803639363-693.295835665049-0.241547565718181
4914423.716274.807296587597.7434799940832-1851.1072965875-1.15008810602703
5016789.416592.4406258495101.36544608688196.9593741504870.379705018855491
5116782.216189.025714056791.9210257845975593.174285943283-0.864714889736485
5214133.814882.593156534763.6402016941964-748.793156534742-2.39275906912631
531260713877.981766978441.6667644730760-1270.98176697844-1.83763748476646
5412004.512686.805829823816.9183970773988-682.305829823762-2.13245739655853
5512175.412214.48628025627.48460512561205-39.0862802561969-0.848444374173807
561326812485.164554186512.3610931170309782.8354458134580.456544099362177
5712299.312152.45658662566.1963179923449146.843413374378-0.598043717279071
5811800.612391.647797828610.2124111880962-591.047797828550.403398419545134
5913873.312545.856622533712.61451961440261327.443377466300.249254179390781
6012269.612653.769272548814.1809859140995-384.1692725487890.165072824014381
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/1jbbh1260112384.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/1jbbh1260112384.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/2zoaz1260112384.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/2zoaz1260112384.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/3imt81260112384.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/3imt81260112384.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/44oxf1260112384.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/44oxf1260112384.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/5j0ns1260112384.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/06/t1260112435zt73r4i51ttopcz/5j0ns1260112384.ps (open in new window)


 
Parameters (Session):
par1 = multiplicative ; par2 = 12 ;
 
Parameters (R input):
par1 = 12 ; par2 = 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