Home » date » 2009 » Dec » 04 »

WS9

*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, 03 Dec 2009 17:58:30 -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/t1259888367xq8abb03ib7sv4p.htm/, Retrieved Fri, 04 Dec 2009 01:59:34 +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/t1259888367xq8abb03ib7sv4p.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 «
10284,5 12792 12823,61538 13845,66667 15335,63636 11188,5 13633,25 12298,46667 15353,63636 12696,15385 12213,93333 13683,72727 11214,14286 13950,23077 11179,13333 11801,875 11188,82353 16456,27273 11110,0625 16530,69231 10038,41176 11681,25 11148,88235 8631 9386,444444 9764,736842 12043,75 12948,06667 10987,125 11648,3125 10633,35294 10219,3 9037,6 10296,31579 11705,41176 10681,94444 9362,947368 11306,35294 10984,45 10062,61905 8118,583333 8867,48 8346,72 8529,307692 10697,18182 8591,84 8695,607143 8125,571429 7009,758621 7883,466667 7527,645161 6763,758621 6682,333333 7855,681818 6738,88 7895,434783 6361,884615 6935,956522 8344,454545 9107,944444
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
110284.510284.5000
21279211178.0006250137111.819530865139110.9736513652651.46556684007203
312823.6153811805.0209409104160.528437059664158.4458206328170.835148915654928
413845.6666712584.1131602931208.035118296676203.3246537388971.01898289532986
515335.6363613622.7695948084262.895643531683252.8786501795561.39540317460509
611188.512849.4169400771201.275522155952200.291851305065-1.76894259145977
713633.2513183.9928433147208.670161409690206.2015700045230.23011101837892
812298.4666712941.1903130704184.690066641970188.351835510623-0.784802390529522
915353.6363613832.4029717134221.277946690684213.651528038081.23278699680744
1012696.1538513509.6670727545193.479256126687195.806347026147-0.950668440091467
1112213.9333313119.4155542252163.82110360036178.121940889089-1.02009291472283
1213683.7272713360.3613724045167.735473111296180.2923639481450.134653735166101
1311214.1428613455.7892066749171.974989508829-2075.07799431662-0.177190418272952
1413950.2307713681.0193540784175.302355452837190.8095898749790.0773269028209501
1511179.1333312786.3646281729114.535443923396156.825381758847-1.69803891798577
1611801.87512446.836579744990.3485881705442145.350428825921-0.752090679267918
1711188.8235312005.266675281863.1082011666263134.389581136806-0.899678739742892
1816456.2727313572.3083687124138.462524192561160.3138294810772.56951575518179
1911110.062512737.475906029890.1947053719671145.938372551318-1.67045334700007
2016530.6923114080.4896888586152.136107488979162.1297833171062.15369348706394
2110038.4117612697.954519721776.1628835418008144.468654926932-2.63847458663471
2211681.2512337.881298780354.4875985658019139.935459703266-0.74947452681078
2311148.8823511904.118215192730.109050016494135.30395682661-0.837926575775196
24863110719.2761979301-30.8796445203961124.696470815857-2.08245901937169
259386.44444410708.1562127416-30.4556246854229-1358.830902649570.0384012644183710
269764.73684210285.0890834710-52.8032219148085114.403426594338-0.612334328272692
2712043.7510853.5701730321-18.8598556140306125.1041229088381.01494119789880
2812948.0666711551.293501955819.3090515251865134.3777461092821.19601161434594
2910987.12511313.68915695615.82610626724678131.827344407195-0.433050641794794
3011648.312511389.80186734189.48514991193954132.3757667847640.118992462234861
3110633.3529411079.0630876294-7.12139379590471130.360313367273-0.54306627724927
3210219.310721.5743573603-25.2678412304869128.535219370353-0.594467742916478
339037.610059.1184898258-58.2767509747441125.721162392824-1.08098750957680
3410296.3157910061.3880758473-55.1368779969586125.9527845208510.102677157673894
3511705.4117610567.6425124901-25.9802542193340127.8474884309560.951565876298631
3610681.9444410546.1016479528-25.7493030842043127.86090765780.00752094145496387
379362.94736810596.9244134358-22.5403641131402-1369.64920301450.138772584674055
3811306.3529410800.0992198359-10.1638710327746128.1216737857960.361810250659946
3910984.4510814.0658126330-8.86410050279724128.3949712303150.0398595063337
4010062.6190510491.656156089-25.5745824152579125.865688769123-0.524824269424504
418118.5833339579.1648766682-72.552063106758120.713545988986-1.49297462073966
428867.489234.52757090855-86.9138386962373119.557669602085-0.459042860257614
438346.728818.13448310904-104.273497245977118.514299141072-0.556291183632599
448529.3076928605.36816529494-109.985043195555118.252437963843-0.183198760812948
4510697.181829241.42609354124-70.7195220980523119.6589771734261.25957049786890
468591.848920.52456036795-83.8883289655605119.280931151903-0.422294456120336
478695.6071438743.3812810445-88.7983904712855119.165051341506-0.157371666958283
488125.5714298422.325585081-101.031880266892118.921878488315-0.391855629864747
497009.7586218320.21049948783-101.084565444588-1308.56374884483-0.00191117509007912
507883.4666678051.80064396142-110.088258464870116.90133903832-0.271848964717028
517527.6451617749.45571907578-120.351615085586115.272858768103-0.31937803883799
526763.7586217276.41844905973-139.094533635412113.222702850316-0.591423222978227
536682.3333336933.48060326773-149.899682273902112.409536046902-0.34311822312988
547855.6818187127.59917174161-131.690821488625113.3528896405260.579842258504568
556738.886863.14856403698-138.712084072729113.101906529589-0.223841077911853
567895.4347837103.69228851225-118.663030556368113.5982824364440.63941754856377
576361.8846156720.8495201476-132.625841091782113.357555753568-0.445327217279059
586935.9565226672.28241552737-128.183347540341113.4112808584940.141671873380362
598344.4545457149.22235035013-96.2022689670068113.6851785285271.01970608868122
609107.9444447749.45195552104-59.3933602652303113.9111715106881.17341899904332
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/1ah0t1259888307.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/1ah0t1259888307.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/32tll1259888307.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/32tll1259888307.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/48hv21259888307.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/48hv21259888307.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/5vrnl1259888307.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259888367xq8abb03ib7sv4p/5vrnl1259888307.ps (open in new window)


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