Home » date » 2009 » Dec » 12 »

*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, 12 Dec 2009 10:02:22 -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/12/t12606378572oe8qk40bzae7gi.htm/, Retrieved Sat, 12 Dec 2009 18:11:04 +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/12/t12606378572oe8qk40bzae7gi.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 «
4716.99 4926.65 4920.10 5170.09 5246.24 5283.61 4979.05 4825.20 4695.12 4711.54 4727.22 4384.96 4378.75 4472.93 4564.07 4310.54 4171.38 4049.38 3591.37 3720.46 4107.23 4101.71 4162.34 4136.22 4125.88 4031.48 3761.36 3408.56 3228.47 3090.45 2741.14 2980.44 3104.33 3181.57 2863.86 2898.01 3112.33 3254.33 3513.47 3587.61 3727.45 3793.34 3817.58 3845.13 3931.86 4197.52 4307.13 4229.43 4362.28 4217.34 4361.28 4327.74 4417.65 4557.68 4650.35 4967.18 5123.42 5290.85 5535.66 5514.06 5493.88 5694.83 5850.41 6116.64 6175.00 6513.58 6383.78 6673.66 6936.61 7300.68 7392.93 7497.31 7584.71 7160.79 7196.19 7245.63 7347.51 7425.75 7778.51 7822.33 8181.22 8371.47 8347.71 8672.11 8802.79 9138.46 9123.29 9023.21 8850.41 8864.58 9163.74 8516.66 8553.44 7555.20 7851.22 7442.00 7992.53 8264.04 7517.39 7200.40 7193.69 6193.58 5104.21 4800.46 4461.61 4398.59 4243.63 4293.82
 
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
14716.994716.99000
24926.654915.8238934648212.291776647980710.82610653517720.474143182426502
34920.14909.3268332928211.478358355738010.7731667071821-0.0734824681006915
45170.095158.6875485341526.014198440962511.40245146585320.921510114350787
55246.245234.7153717612529.842533826946611.52462823875400.192107471638571
65283.615272.068666527230.514930258978211.54133347279690.0286401383000769
74979.054968.1779507151-2.9770307555556010.8720492848993-1.26741586773592
84825.24814.5966152821-19.343967019337610.6033847178987-0.56796472904498
94695.124684.69108854291-32.101694909912510.4289114570866-0.415292614347238
104711.544701.04384669712-26.257572588702610.49615330287670.181431462760696
114727.224716.67296336093-21.037399494114010.54703663906650.156452449748119
124384.964374.75299305129-62.010690711178410.2070069487136-1.19624486917932
134378.754436.73343869824-47.7041255128459-57.9834386982390.54484929709266
144472.934465.89583591745-37.41234591126827.034164082550520.242844075962779
154564.074557.04150936607-20.33173985185797.028490633932830.477273329575311
164310.544303.50260130892-51.55627732486397.0373986910815-0.865276390319022
174171.384164.33970554415-63.35364913472957.04029445584965-0.324906830983984
184049.384042.33802915334-71.28521903139237.04197084666357-0.217436545685577
193591.373584.31847453474-123.7541032952207.05152546526229-1.43345909869020
203720.463713.41387187157-89.36810820602597.046128128431540.937033817508478
214107.234100.19265105717-24.50048048073377.037348942827431.76431044845353
224101.714094.67295328399-21.91123630003977.037046716008660.0703241064200002
234162.344155.30408812257-10.64025154586787.035911877434750.305797827925542
244136.224129.18390437811-12.75554880397467.03609562189286-0.0573458877171195
254125.884188.23893747785-3.11678906716208-62.35893747785130.289731068152174
264031.484028.10070478333-24.38101111345913.37929521666738-0.529160684893247
273761.363757.92118652420-58.01483605192273.43881347580425-0.9102431428449
283408.563405.05956319205-98.36695953494943.50043680794973-1.09190368296418
293228.473224.95481818324-109.5548684275493.51518181676425-0.302705118195113
303090.453086.93038547113-113.4520451684333.51961452886704-0.105435258230845
312741.142737.58868550287-145.7452869277943.55131449712617-0.87361740661691
322980.442976.93335069631-93.02339821950953.506649303692961.42620229767075
333104.333100.84506724284-63.32185886247743.484932757164620.803442188384188
343181.573178.09721279508-44.07454727177933.472787204921150.520636908689185
352863.862860.36680639736-81.54443591468923.49319360264471-1.01353612875065
362898.012894.524252856-65.70177737732183.485747143999630.428527702181873
373112.333111.68071084429-27.29294006366390.649289155711921.11018305782392
383254.333252.58198045968-4.49129950171681.748019540322120.582396729051283
393513.473511.7764559108931.62199202703121.693544089108640.97645256497049
403587.613585.924036902137.44580897553481.685963097897150.157481621939537
413727.453725.7797933015751.4701946108321.670206698433690.379257671785835
423793.343791.6717083190753.4451093420641.668291680926090.0534096839371694
433817.583815.9083609300649.44535604478771.67163906993779-0.108173430408701
443845.133843.456195046646.44677688140151.67380495339840-0.0810988394344724
453931.863930.1896341425551.9634801964271.670365857451730.149206410047856
464197.524195.8653796076481.22836640727871.654620392356700.791518731463537
474307.134305.4771844285385.11507777489341.652815571467370.105123906839561
484229.434227.7682486880562.8186042633891.66175131195165-0.603057870740139
494362.284372.1826589797773.9279075564652-9.902658979773220.315786596542491
504217.344218.3789370778843.0006322761441-1.03893707788023-0.800393009891683
514361.284362.3358790662856.8272562125938-1.055879066283360.373865937961279
524327.744328.7827894602744.4496948531407-1.04278946026654-0.334710182348936
534417.654418.6984724606250.676034628179-1.048472460622230.168380595553360
544557.684558.7381127885162.9136494584889-1.058112788511370.330959548503073
554650.354651.4108835066766.9888554396978-1.060883506666930.110215274502267
564967.184968.26096115749101.204453736285-1.080961157486580.92539436899065
575123.425124.50477822304108.741413871920-1.084778223039920.203848137453370
585290.855291.93829122378116.778547518771-1.088291223775150.217378977263251
595535.665536.75490546699134.311707600534-1.094905466987730.474221112831057
605514.065515.14795391804112.960656443390-1.08795391804169-0.577488284858046
615493.885492.9624639606394.53753249872350.91753603936832-0.518577928452614
625694.835694.16102348844109.0427431552120.668976511557310.378444331402451
635850.415849.74752593441115.4170986032270.6624740655875060.172368407652804
646116.646115.99571780659136.0731616375240.6442821934084870.558595597647032
6561756174.34762749772125.4296749307680.652372502275441-0.287842657372996
666513.586512.94677845454154.6214605762090.6332215454580920.789492014875746
676383.786383.12472368476115.6697900540400.655276315244423-1.05347679181640
686673.666673.01638240153139.5275235886930.643617598467870.645263145153977
696936.616935.97351108528156.4297442713820.6364889147190630.457149231481348
707300.687300.05386168012184.8649612779960.6261383198811160.769087320776314
717392.937392.29987717766172.1819384331690.630122822339113-0.343040591962557
727497.317496.67735964767162.8969529758210.632640352333754-0.251134670148619
737584.717595.98851243948154.222183930943-11.2785124394809-0.242587193683522
747160.797163.298579977474.3251537458699-2.50857997740033-2.09615699538332
757196.197198.6939174245868.9936342680549-2.50391742457799-0.144174533300344
767245.637248.1319007355966.3155428998391-2.50190073558575-0.0724248136395152
777347.517350.0150663685971.1863083849607-2.505066368591110.131727794391126
787425.757428.2556082394472.1523257701151-2.505608239437480.0261263476820294
797778.517781.03421262287110.581288348258-2.524212622873311.03935167459402
807822.337824.85039249436101.438538125693-2.52039249436380-0.247279570629184
818181.228183.75310663398136.695291393995-2.533106633979750.953584763074233
828371.478374.0053892257144.029288724178-2.535389225704060.198363566572881
838347.718350.23921710754121.051700658928-2.52921710754449-0.621482221174525
848672.118674.64567291107148.898712863899-2.535672911068120.753191119910407
858802.798777.56885015513142.62301585278725.221149844873-0.174676268283618
869138.469139.60046868351172.514008884709-1.140468683509670.78741058187347
879123.299124.41088022865146.807886384767-1.12088022865161-0.695162404777605
889023.219024.30864954734112.994450835427-1.09864954733887-0.91445080278711
898850.418851.486439948473.8537513436139-1.07643994839492-1.05856010987136
908864.588865.652437011865.6800280022417-1.07243701180828-0.221064351685476
919163.749164.8259517986697.6546400260065-1.085951798658860.864794429344212
928516.668517.70874699143-4.33384005982002-1.0487469914273-2.75845109364271
938553.448554.490519646351.29647987327590-1.050519646350450.152283249500874
947555.27556.21332555107-135.583616982515-1.01332555107067-3.70222671546491
957851.227852.24718672509-76.478617885217-1.027186725089021.59863617553322
9674427443.01796394945-122.044951144962-1.01796394944658-1.23245629015078
977992.537949.43349181159-36.224652467603843.09650818841222.38027621180336
988264.048266.3133230084911.9085426029695-2.273323008490681.27191057413278
997517.397519.59311124382-91.9852621817703-2.20311124382117-2.80962772561542
1007200.47202.58513439162-122.80114939434-2.18513439162517-0.833398554455185
1017193.697195.88313928954-106.902176930406-2.193139289536860.429992843692330
1026193.586195.71998412694-229.226474643052-2.13998412693853-3.30838015469042
1035104.215106.30580661488-347.020669364046-2.0958066148797-3.18591649669571
1044800.464802.55772467492-341.094948687163-2.097724674915560.160271944492674
1054461.614463.70781055924-340.787516058197-2.097810559237760.0083151603860756
1064398.594400.69698180428-302.749137257229-2.106981804282141.02883541325194
1074243.634245.74119322935-282.510520532841-2.111193229347050.547402958611653
1084293.824295.93937561659-236.949847608641-2.119375616590081.23230507978733
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/1cmdo1260637339.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/1cmdo1260637339.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/22dhk1260637339.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/22dhk1260637339.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/39eu01260637339.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/39eu01260637339.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/42lvp1260637339.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/42lvp1260637339.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/5hh5e1260637339.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/12/t12606378572oe8qk40bzae7gi/5hh5e1260637339.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = 0.2 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 0 ;
 
Parameters (R input):
par1 = 12 ; par2 = 0.2 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 0 ;
 
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