Home » date » 2010 » Dec » 09 »

ws5q5

*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: Thu, 09 Dec 2010 18:54:41 +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/09/t1291920769bfyqwj53t3xfxr8.htm/, Retrieved Thu, 09 Dec 2010 19:52:55 +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/09/t1291920769bfyqwj53t3xfxr8.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 «
13328 12873 14000 13477 14237 13674 13529 14058 12975 14326 14008 16193 14483 14011 15057 14884 15414 14440 14900 15074 14442 15307 14938 17193 15528 14765 15838 15723 16150 15486 15986 15983 15692 16490 15686 18897 16316 15636 17163 16534 16518 16375 16290 16352 15943 16362 16393 19051 16747 16320 17910 16961 17480 17049 16879 17473 16998 17307 17418 20169 17871 17226 19062 17804 19100 18522 18060 18869 18127 18871 18890 21263 19547 18450 20254 19240 20216 19420 19415 20018 18652 19978 19509 21971
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
11332813328000
21287313200.68194781453.82578918514634-327.68194781448-1.30937963159356
31400013460.239175026122.0031954161445539.7608249738651.31765525270691
41347713535.980420899126.285105942988-58.98042089910190.311977226123143
51423713789.367306105442.1871681780315447.6326938945811.58162610681454
61367413834.089406732442.3300535845046-160.0894067323570.0192376923718027
71352913756.221415002136.7762045798851-227.221415002069-0.937057013630214
81405813824.126311763838.052962469584233.8736882362300.243826417267901
91297513582.498775267426.9841057964398-607.498775267415-2.18590323595731
101432613729.720459629231.8225898323746596.2795403707720.935766933751675
111400813869.974239000436.3499767303937138.0257609995870.840035252978843
121619314657.836502122868.96004509823561535.163497877235.79802749363536
131448314941.154811152173.6530809516055-458.1548111520811.70324729921804
141401114973.533754067972.56610002109-962.533754067875-0.330836466619584
151505714910.422651392366.9424354256193146.577348607663-1.01555961592100
161488414966.957094087366.3965410181129-82.9570940873432-0.0738137548231807
171541414983.556371205163.5594131342866430.443628794902-0.353622835038707
181444014842.047094907351.8576431761596-402.04709490728-1.49507756240521
191490014877.713299010550.96589226503822.2867009895442-0.120639961851066
201507414855.421556101747.1049651949951218.578443898257-0.551266726939755
211444214996.315769437551.8605348170913-554.3157694374570.706960235998102
221530715087.067621877253.7716010293883219.9323781228000.292538866816767
231493815228.059675091957.9402455145203-290.0596750918540.654261787956202
241719315465.375070008966.29938861369761727.624929991061.34474028856297
251552815699.544232176374.0185876088331-171.5442321763311.26208555258566
261476515769.063338417073.806527430363-1004.06333841696-0.0337794511447212
271583815770.367127643670.205950248940967.6328723564073-0.537689018234094
281572315767.917838339166.4079039138715-44.9178383390633-0.531044660759293
291615015725.662845630060.5361068853177424.337154370023-0.790177339025636
301548615780.286200526860.2124988847452-294.286200526844-0.0432200309184316
311598615877.398174020462.22620836171108.6018259795550.271983421683458
321598315928.746878529861.639751111918954.2531214702492-0.0806101036648515
331569216100.431723783267.4797360289696-408.4317237832090.81632027217282
341649016282.106735345273.4467240256002207.8932646548390.845799882141688
351568616325.337478227571.8873726200522-639.337478227512-0.223472602865751
361889716661.113104020385.40975683355732235.886895979681.95194819402148
371631616723.023036009384.2053883081234-407.023036009263-0.174005251309701
381563616713.717226233479.3759710442796-1077.71722623338-0.692066109425585
391716316831.896475851781.4053879883748331.1035241482940.286209760715423
401653416796.136125745675.1967487352262-262.136125745639-0.86037097664727
411651816595.816779431360.4514073538403-77.8167794313284-2.01850104025196
421637516599.730785008857.4101151607113-224.730785008773-0.414637749542108
431629016513.587846713049.6847772582255-223.587846712959-1.05576587816445
441635216484.454074275145.4561734049545-132.454074275099-0.580951664466268
451594316491.109234458843.3849047873067-548.109234458764-0.286122147509981
461636216429.598346882137.815399736733-67.598346882089-0.772925383912537
471639316668.133255975648.4259559578775-275.1332559755951.47794698241834
481905116787.41597010552.16249745091092263.584029895000.521772960478365
491674716927.734024717156.8111048941409-180.7340247171030.649499979507535
501632017113.092879123763.6042499082173-793.0928791237350.947131566555392
511791017270.641819616168.5861444166098639.3581803838520.69150670359207
521696117247.892451613563.7246326602895-286.892451613550-0.6713115311164
531748017325.119147574564.44543616219154.8808524255410.0991472221876955
541704917312.085857678860.3022709007103-263.085857678771-0.569037817998455
551687917242.367161210853.3470467335768-363.367161210762-0.955814972472107
561747317351.520995702956.3300330641291121.4790042971490.410589954146277
571699817478.752768527160.1143242071860-480.7527685271210.521754101189441
581730717568.474110901461.691898610739-261.4741109013570.217805644509610
591741817693.326983682765.0524784499592-275.3269836826860.464495230746059
602016917860.249436108470.46794926488242308.750563891640.749166786818708
611787118029.640552299175.7261447209669-158.6405522990910.727666511577185
621722618110.524511571076.0004589058506-884.524511571040.037944235448267
631906218234.557270025478.5575403847418827.4427299745510.353264630573422
641780418242.178761141874.7770526629889-438.178761141842-0.521457348362567
651910018466.945732505982.7777917258623633.054267494051.10218502294869
661852218650.201525230588.1403602173717-128.2015252305060.73835603786959
671806018689.728781975285.5454667378949-629.728781975174-0.357337570795217
681886918776.808002847085.627320804457692.19199715304160.0112775352566685
691812718804.713585938182.5480841697832-677.713585938127-0.42445991711634
701887118981.106581688887.5518061361308-110.1065816888410.690013654175918
711889019161.423566353392.4956725488576-271.4235663532570.681978362131513
722126319208.507758233190.076216896682054.49224176685-0.333844069038362
731954719420.193348132696.5548995781493126.8066518674270.894098448192825
741845019505.387402129295.9495720151657-1055.38740212923-0.0835331354626137
752025419548.926510694993.156264971797705.073489305116-0.385335983346102
761924019680.040091267495.179909819775-440.0400912674120.279026604563751
772021619740.596376184593.3334981259738475.403623815547-0.254484208719289
781942019722.656344817787.3984851366954-302.656344817737-0.817847173612272
791941519854.736950351389.781836279546-439.7369503512840.328439734536982
802001819957.235716873590.460129309855960.76428312645370.0934873708840648
811865219856.486091141780.262607332886-1204.48609114171-1.40571677346299
821997819952.938898406981.12592629082225.06110159313020.119020635507625
831950919964.546753736877.4195110990556-455.54675373678-0.51102528352137
842197120006.558195266375.53188981643711964.44180473367-0.260279917278426
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/1vnnp1291920874.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/1vnnp1291920874.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/2ofms1291920874.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/2ofms1291920874.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/3ofms1291920874.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/3ofms1291920874.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/4z63d1291920874.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/4z63d1291920874.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/5z63d1291920874.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291920769bfyqwj53t3xfxr8/5z63d1291920874.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