Home » date » 2010 » Dec » 18 »

STSM

*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: Sat, 18 Dec 2010 12:52:36 +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/Dec/18/t1292676632yq6ebxmw3ml58wk.htm/, Retrieved Sat, 18 Dec 2010 13:50: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/2010/Dec/18/t1292676632yq6ebxmw3ml58wk.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 time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
13737000
23034.0671084504094-0.315647737896301-0.315647736716693-0.291557373239402
34739.27542649057570.113018011095180.1130180110951780.578107230534407
43537.59882463196710.006090945121043940.0060909451210442-0.194826690254935
53034.6319916237495-0.138701840871005-0.138701840871004-0.3327193574072
64337.82933132225630.0002856511347465230.0002856511347463580.380389932955922
78254.7345620252830.6263475557671660.6263475557671671.9516353763694
84049.27553925084670.4201592596649330.420159259664934-0.708355611710072
94748.51401169657640.3827646135146440.382764613514644-0.138315763526530
101937.44183716348760.03933647180019190.0393364718001923-1.34590443540171
115242.94931817810260.1961707140879290.1961707140879290.644219300663072
1213678.09342490574481.161409340139551.161409340139544.12554663337715
138082.40512879301360.803640420332868-8.840044627433430.530695402530692
144265.0516154426220.0542732808513140.0542732923496264-1.77265794694282
155460.6291424886599-0.0882433345724525-0.0882433345724519-0.486103539806455
166662.6908736996413-0.0332820757823487-0.03328207578235070.244989301253035
178169.65998184906970.1173069759266820.1173069759266840.817044166716085
186367.1730867934370.0681274540753310.0681274540753288-0.307662325615526
1913793.4364577444030.5179943208136380.517994320813643.11620637069108
207285.53136828141930.3829471312091160.382947131209119-1.00607627066500
2110793.66083820161420.5010775887356970.5010775887356980.927553150304634
225880.45812733098980.2997695582351570.299769558235159-1.64344369789465
233663.92819487506310.05958395043225360.0595839504322537-2.02042796921583
245259.4900687050896-0.00312604141474305-0.00312604141474494-0.54034738640311
257965.1690060817906-0.2969582172943133.266540376667480.816165036492403
267769.9327176397053-0.163315956956953-0.1633159455385470.539272850845273
275463.696619994003-0.286952611242518-0.286952611242513-0.689459781792143
288471.361935332189-0.15642868646816-0.1564286864681620.929872419065168
294862.5185472204572-0.27701760417005-0.277017604170044-1.03081304168558
309674.99792153124-0.120646343560960-0.1206463435609631.52551249389633
318377.9573560741685-0.086122045861719-0.08612204586171640.369942030387921
326673.4756554444656-0.132363334029531-0.132363334029526-0.529281929120724
336168.7937784664887-0.178117812451621-0.178117812451619-0.548659557065844
345362.8678232306838-0.234077744574632-0.23407774457463-0.693843428894893
353050.5756044641092-0.348675414200005-0.348675414200005-1.45649856561658
367459.2017176099048-0.264959393837943-0.2649593938379461.08452209496677
376961.189327525208-0.340371246299083.744083697899630.306763102795221
385960.2507045095553-0.351987476238834-0.351987464594544-0.0662477595957704
394253.1654628542818-0.452754206075758-0.452754206075749-0.78005018736377
406557.5263499840013-0.394569177253741-0.3945691772537410.569637436002642
417062.1044147754013-0.343605642903206-0.34360564290320.594750080138199
4210076.1680237933218-0.212868237585064-0.2128682375850661.73293648170817
436371.2077589022676-0.252364401924127-0.252364401924125-0.572834761579663
4410583.7167842250474-0.152464757185518-0.1524647571855161.54266391728603
458283.0393997660179-0.156402951636845-0.156402951636844-0.0635256883153927
468182.2413690241213-0.161074345587819-0.161074345587817-0.077703578920588
477579.5098014807554-0.179386215058064-0.179386215058065-0.311435531989578
4810287.817101121155-0.119908849226321-0.1199088492263241.02853430266919
4912198.1776819780824-0.3793096932152474.172406608634311.38956317156998
509898.0252747333647-0.375826144700893-0.3758261280638040.0256752879138793
517689.551325373142-0.471636492175208-0.471636492175192-0.949061242123092
527784.7142597088665-0.513397339314662-0.513397339314667-0.520171725959087
536376.4679979380646-0.57621152654483-0.576211526544819-0.92914821466339
543761.6153896802288-0.679051361969763-0.679051361969767-1.72302404363950
553551.5421475741942-0.741189251124894-0.741189251124895-1.13660580672317
562340.7466735646845-0.803861378156782-0.803861378156778-1.21823086562640
574040.2625458498069-0.801948473910867-0.8019484739108650.0387744205668611
582935.8754051069844-0.822793631044984-0.822793631044981-0.435015163561924
593736.0806287449173-0.81693680382169-0.8169368038216920.124779247320516
605141.405660226982-0.782464317764402-0.7824643177644060.745672601407395
612030.8153767243869-0.5899092308835116.48900153172886-1.27958596784119
622829.5928933011181-0.597939930575799-0.597939922317725-0.0725786997937341
631323.1643183013491-0.654977400054657-0.654977400054645-0.688443430875821
642222.5639431191055-0.654545208976197-0.6545452089761970.00653550317436943
652523.3065338765099-0.645145845616579-0.6451458456165720.168379161783554
661319.3067220149444-0.665180438385684-0.665180438385686-0.405776123043721
671617.9072739317707-0.66921117713715-0.66921117713715-0.088997803780667
681315.9132662950303-0.676071448510229-0.676071448510227-0.160764796809479
691615.7710514277892-0.673415470849055-0.6734154708490530.0648302167189355
701716.0530129272959-0.668791874403398-0.6687918744033950.116070036876449
71913.2647382145488-0.678852258164591-0.678852258164592-0.257571298837704
721714.4742987179818-0.670013553542685-0.6700135535426880.229532516514790
732515.1084490094974-0.6912306520880337.603537165878650.168326295267939
741414.5224713530272-0.690091594327187-0.6900915872821250.0121933502314133
75811.8921752047423-0.706269825998804-0.706269825998792-0.230287014248023
7679.88411967373391-0.715057228451049-0.71505722845105-0.156306743395605
77109.74499100434729-0.711750641328668-0.7117506413286630.0695565566603299
7878.5420505110587-0.714255872149867-0.71425587214987-0.0595069932557826
79108.89933968941821-0.709228709422989-0.7092287094229870.130042001338295
8036.52786353021991-0.71659043105388-0.716590431053878-0.201933369779238
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/1ttdj1292676751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/1ttdj1292676751.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/2m3cn1292676751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/2m3cn1292676751.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/3ecb71292676751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/3ecb71292676751.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/4ecb71292676751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/4ecb71292676751.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/57lta1292676751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292676632yq6ebxmw3ml58wk/57lta1292676751.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