Home » date » 2010 » Nov » 30 »

Structural decomposition

*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, 30 Nov 2010 15:46:51 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s.htm/, Retrieved Tue, 30 Nov 2010 16:45:42 +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/2010/Nov/30/t129113193671gmvpyyqo9tu0s.htm/},
    year = {2010},
}
@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 = {2010},
    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 «
37 30 47 35 30 43 82 40 47 19 52 136 80 42 54 66 81 63 137 72 107 58 36 52 79 77 54 84 48 96 83 66 61 53 30 74 69 59 42 65 70 100 63 105 82 81 75 102 121 98 76 77 63 37 35 23 40 29 37 51 20 28 13 22 25 13 16 13 16 17 9 17 25 14 8 7 10 7 10 3
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'George Udny Yule' @ 72.249.76.132


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
13737000
23034.0671216941213-0.315647564790337-0.31564756420223-0.291558207717331
34739.27541596478730.1130184938076020.1130184938076020.578107943214642
43537.59882378640050.006091333242066470.00609133324206532-0.194826675503084
53034.6320001040144-0.138701975676196-0.138701975676196-0.332720022217105
64337.82932625327510.0002859075810164870.0002859075810150990.380390337897555
78254.73450550022650.626350141523850.6263501415238541.95163954894543
84049.27552460028290.4201618229175260.420161822917527-0.708354793270166
94748.51400713370290.3827671798771180.382767179877118-0.138315627892971
101937.44187347669510.03933812873206840.0393381287320691-1.34590727617731
115242.94932257135650.1961723047496650.1961723047496650.644218893332828
1213678.09330797922821.161412817377921.161412817377924.12555501966769
138082.4050376745860.803640669539752-8.840047359844710.530702819484212
144265.05162295483780.05427628368130060.0542762800922897-1.77265834157425
155460.6291616810058-0.0882405583830091-0.088240558383007-0.486105172608378
166662.6908790939866-0.0332794524032328-0.03327945240323800.244988724128414
178169.65996225760090.1173098829154240.1173098829154240.817045414994713
186367.17308430926340.06813032041421840.0681303204142267-0.307662362506208
1913793.43636471509410.5179984696757560.5179984696757623.11621286205938
207285.53134118348370.3829514108030860.382951410803083-1.00607462956371
2110793.66079446453950.5010822847675110.5010822847675120.927555972162997
225880.45815070836470.2997739527063160.299773952706319-1.64344569595362
233663.92827179193320.05958763395301890.0595876339530240-2.02043376961061
245259.4901342371581-0.00312292677736641-0.00312292677736388-0.540352334075333
257965.1690426899526-0.2969538191643173.266492013211260.816165646442566
267769.9327223130034-0.163312320080150-0.1633123225189200.539272135660072
275463.696644480193-0.286949059374766-0.286949059374757-0.689461813374959
288471.36192367388-0.156425160934276-0.1564251609342790.929873009781318
294862.5185716246564-0.277014316578656-0.277014316578658-1.03081504793801
309674.9978916868859-0.120642791282769-0.1206427912827581.52551438746289
318377.957327068086-0.0861183040178078-0.08611830401779920.369943849126872
326673.475654327657-0.132359631914891-0.132359631914895-0.529282107445417
336168.7937954814648-0.178114250777881-0.178114250777882-0.548661028790547
345362.8678560875564-0.234074404504519-0.234074404504517-0.693846020030631
353050.5756706788763-0.348672470763643-0.348672470763633-1.45650350855119
367459.201726585533-0.264956524801259-0.2649565248012551.08452121249381
376961.1893369280218-0.3403683765759453.744052143850240.306764690482265
385960.2507129540982-0.351984696680386-0.351984698212666-0.066248576140395
394253.1654926142638-0.452751478680410-0.452751478680399-0.780052519204419
406557.5263519187164-0.394566544141757-0.3945665441417540.569637095178366
417062.1043985930574-0.343602933535737-0.3436029335357410.594751043722194
4210076.1679614815683-0.212865165055240-0.2128651650552351.73294071933137
436371.2077381412589-0.252361260117054-0.252361260117045-0.572833479964084
4410583.7167245568239-0.152461310528321-0.1524613105283201.54266792276289
458283.0393651242567-0.156399367687836-0.156399367687836-0.0635234520492033
468182.2413505760636-0.161070698414878-0.161070698414877-0.0777025118569286
477579.5098004563027-0.179382579357404-0.179382579357389-0.311435709355405
4810287.8170695670264-0.119905104111077-0.1199051041110731.02853626661158
4912198.1776365906012-0.3793057675557154.172363446055251.38956946142677
509898.0252471038806-0.375822002172828-0.37582200510390.0256770062449916
517689.551338558132-0.471632224648908-0.471632224648893-0.949062463098624
527784.7142848944818-0.513393193667197-0.513393193667215-0.520173830686708
536376.4680432022279-0.576207605766888-0.576207605766901-0.929151736810298
543761.6154720271693-0.679047834469404-0.67904783446939-1.72303017901997
553551.5422352461928-0.741186105626393-0.741186105626385-1.13661230541679
562340.7467671380797-0.803858613012813-0.803858613012816-1.21823775261747
574040.262604186947-0.801945924159431-0.801945924159430.0387700424106709
582935.8754559445217-0.822791267543264-0.822791267543263-0.435018971173871
593736.0806574502545-0.816934544693994-0.8169345446939760.124777017289439
605141.4056556852203-0.782462054720102-0.7824620547200950.745672735826488
612030.8154211638528-0.5899077066953996.4889847728376-1.27958777101575
622829.5929232536214-0.597938619671958-0.597938618900505-0.0725809712450768
631323.1643585852979-0.654976183051592-0.654976183051577-0.688446400776884
642222.5639684032535-0.654544118317453-0.6545441183174530.00653360043588675
652523.3065448214487-0.645144805925538-0.6451448059255450.168378293764226
661319.3067416834582-0.665179475688209-0.665179475688207-0.40577759389535
671617.9072892961621-0.669210268870825-0.669210268870812-0.0889989704429047
681315.9132811790094-0.676070590934731-0.676070590934732-0.160765922038189
691615.7710589955398-0.673414637318863-0.6734146373188660.0648296106054625
701716.0530142911655-0.668791046538752-0.6687910465387510.116069874743964
71913.2647473091235-0.678851458114668-0.678851458114651-0.257571998873056
721714.4742974934467-0.670012753262825-0.6700127532628160.229532537273078
732515.108446727048-0.6912298404617067.603528243468820.168327091104721
741414.5224697436582-0.690090782816285-0.6900907811986670.0121934073330585
75811.8921815668287-0.706269006103503-0.706269006103486-0.230287521451263
7679.88412868911363-0.715056437033845-0.715056437033845-0.156307444342482
77109.74499471328324-0.711749866376998-0.7117498663770050.0695562316457681
7878.54205488396047-0.714255113106516-0.714255113106513-0.0595073600282687
79108.89933859595211-0.709227947786835-0.7092279477868220.130042020223480
8036.52786932164335-0.716589688967188-0.71658968896719-0.201933830992266
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/1bzj51291132007.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/1bzj51291132007.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/2m80p1291132007.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/2m80p1291132007.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/3m80p1291132007.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/3m80p1291132007.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/4xh0s1291132007.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/4xh0s1291132007.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/57qzw1291132007.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t129113193671gmvpyyqo9tu0s/57qzw1291132007.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
bitmap(file='test1.png')
plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time')
grid()
dev.off()
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='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