Home » date » 2009 » Dec » 04 »

*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: Fri, 04 Dec 2009 05:25:21 -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/04/t12599295669pe316r4bwcd34g.htm/, Retrieved Fri, 04 Dec 2009 13:26:13 +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/04/t12599295669pe316r4bwcd34g.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 «
20366 22782 19169 13807 29743 25591 29096 26482 22405 27044 17970 18730 19684 19785 18479 10698 31956 29506 34506 27165 26736 23691 18157 17328 18205 20995 17382 9367 31124 26551 30651 25859 25100 25778 20418 18688 20424 24776 19814 12738 31566 30111 30019 31934 25826 26835 20205 17789 20520 22518 15572 11509 25447 24090 27786 26195 20516 22759 19028 16971 20036
 
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
12036620366000
22278221193.6675851375958.9347181758261588.332414862530.997276983536058
31916920924.4843277242237.385385001715-1755.48432772419-0.437492457784884
41380716727.0517507557-2218.62355168664-2920.05175075572-1.73937110654325
52974323291.22899239252908.048171644946451.771007607473.32856330234781
62559127164.67867106603456.87449877651-1573.678671065970.342895434537874
72909629875.38734796313038.29426951669-779.387347963149-0.265218197482212
82648228863.1183195991756.640596866757-2381.11831959906-1.45026658659479
92240524643.7348440921-2055.24970013090-2238.73484409214-1.78290175841877
102704424815.3412892653-796.2870847985382228.658710734660.79788885643197
111797020594.9333592384-2731.72090378324-2624.93335923837-1.22685550331592
121873018041.7786043577-2630.82113190869688.2213956422960.0639589718187483
131968417941.3226596808-1209.029720840241742.677340319160.905671678121439
141978516976.2896379384-1071.192042822202808.710362061630.0888683917718068
151847917684.2722047980-79.0737090463728794.7277952020440.623777469104689
161069817853.985761065756.0249926095691-7155.985761065680.0858650176625413
173195623170.37347510622935.283018402998785.62652489381.85693005783753
182950629557.83912707134837.45981268984-51.83912707125551.20767469639308
193450634023.32146648794634.14817202373482.678533512138-0.128233395283186
202716531726.0347443636861.489801120861-4561.03474436356-2.38993447130127
212673629994.2967587512-552.503505558864-3258.29675875124-0.89706647400581
222369123175.8384658944-3974.65822862368515.161534105587-2.16959438384515
231815719624.5008052785-3743.49813450407-1467.500805278520.146545424076826
241732816921.9628292914-3175.53144022084406.0371707086490.360368606101136
251820515390.1210921186-2278.083326066942814.878907881380.57058953523941
262099516664.0275548978-335.9523741649514330.972445102161.23324769979221
271738217277.0723363253180.334664438083104.927663674720.326236378340560
28936719047.40811859761038.85127371424-9680.408118597620.544118254525539
293112423112.60016834022674.763424626858011.399831659841.04324384771461
302655126437.69816216573027.88550077186113.3018378342840.224605054653344
313065127996.16867660812230.958202097272654.83132339190-0.504303814073434
322585929000.19205396281567.90792866891-3141.19205396277-0.419449319291681
332510027138.4299432095-283.372743220674-2038.42994320953-1.17310080388471
342577825487.9281381442-1021.70396643237290.071861855767-0.468241959680586
352041822909.0547076613-1863.04916896555-2491.05470766127-0.533785528846109
361868819652.4171276587-2616.40031000041-964.417127658702-0.478219081961303
372042418145.9972831992-2015.791836675702278.002716800820.381239880619699
382477619263.6610800866-320.6801168345975512.338919913411.07411934126550
391981420470.2232877218502.928463061592-656.2232877217510.521086914453038
401273823113.37567280511653.24787540263-10375.37567280510.729162304600828
413156624521.75659827331521.580621980787044.24340172667-0.0837175067358104
423011128220.23263407072695.134362069321890.767365929290.745879219348724
433001928457.99849036071369.969586043141561.00150963933-0.839814572746483
443193431875.25249192132471.5540716714558.7475080787360.697118496416605
452582629872.174829828168.7404363168002-4046.17482982809-1.52170871095426
462683526574.1301062608-1738.24410910148260.8698937392-1.14590188775832
472020522653.0960196170-2910.44967679836-2448.09601961695-0.74404159149443
481778919330.2173855243-3132.16343074005-1541.21738552429-0.140755866161784
492052018392.0812694051-1951.852789843192127.918730594900.74870643142129
502251817551.1059180449-1354.679343648514966.89408195510.378241476645152
511557216924.2473486072-964.332482578171-1352.24734860720.247097371033234
521150919977.68135683581186.26399857658-8468.68135683581.3633303884715
532544720501.4710065703831.5444725689554945.52899342968-0.225304814152327
542409021504.4456840479923.4941328490332585.554315952090.0584038432930896
552778625317.58634528702474.253251731952468.413654713040.983207468070805
562619525493.74295112981242.73860389668701.25704887024-0.779676939134254
572051623839.9217403962-306.431655162060-3323.92174039622-0.98100859084074
582275921787.7739812756-1239.25411424985971.226018724396-0.591467686998088
591902820893.5151327091-1054.81738691758-1865.515132709110.117072143999097
601697119615.3722642040-1174.34133904716-2644.37226420395-0.0758740948010906
612003618351.9763427279-1222.030462859021684.02365727214-0.0302428817436366
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/1ghsj1259929518.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/1ghsj1259929518.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/2wss31259929518.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/2wss31259929518.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/3pu5t1259929518.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/3pu5t1259929518.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/42mpr1259929518.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/42mpr1259929518.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/55wlw1259929518.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599295669pe316r4bwcd34g/55wlw1259929518.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