Home » date » 2009 » Dec » 21 »

*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: Mon, 21 Dec 2009 02:08:31 -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/21/t126138725591saxannm69576p.htm/, Retrieved Mon, 21 Dec 2009 10:21:02 +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/21/t126138725591saxannm69576p.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 «
43.9 51 51.9 54.3 50.3 57.2 48.8 41.1 58 63 53.8 54.7 55.5 56.1 69.6 69.4 57.2 68 53.3 47.9 60.8 61.7 57.8 51.4 50.5 48.1 58.7 54 56.1 60.4 51.2 50.7 56.4 53.3 52.6 47.7 49.5 48.5 55.3 49.8 57.4 64.6 53 41.5 55.9 58.4 53.5 50.6 58.5 49.1 61.1 52.3 58.4 65.5 61.7 45.1 52.1 59.3 57.9 45 64.9 63.8 69.4 71.1 62.9 73.5 62.7 51.9 73.3 66.7 62.5 70.3
 
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
143.943.9000
25147.04793873982470.242466833752151.361277533335641.26074627467546
351.949.53420445731520.4129879699542430.7649555587114330.838804156120813
454.351.74513526056920.5162125067377411.069821939520450.750065638183191
550.351.44394791805920.480574326747510-0.411927839400074-0.361439218912688
657.253.71367442944990.5438902856392091.823537768366260.812245665555612
748.852.11434549575410.47805805650679-1.28726242350551-0.985070826735972
841.147.7605329490350.342811600505252-2.04994527836049-2.23456079808479
95851.28736047476340.4265338468938183.659912246049871.47734413378979
106356.21455493948080.5396885426222032.458302895170022.09221944455839
1153.855.87338493644260.518301384147634-1.22496659807875-0.409975474867575
1254.755.45247307807140.4961558284273030.153305781609470-0.437501565988379
1355.557.21379362676420.403544336590115-3.099344845756270.742458763455314
1456.157.07713071975010.392992277629068-0.525075027860392-0.234573078051621
1569.662.07357064900030.5523145058736023.98237866941861.90134065412892
1669.465.21301626496490.6340581847465272.077581616219011.12295731789267
1757.263.31561650404260.568944095229283-3.94398964904352-1.14258144736441
186864.05692737539860.5725797565367373.79110406391450.0793874532872976
1953.360.46092474488550.496871557211125-3.43639356611302-1.93847418203173
2047.956.89532277457940.429988951815727-5.34213010193577-1.89781595802939
2160.857.23000387211720.4285123575235823.65597926641452-0.0446256332810679
2261.758.0787993937150.4347330659158893.241320495445870.197037454541535
2357.858.6654798900170.436790180774811-1.00311996129540.0713087354670697
2451.456.52058616977730.415703256923539-2.76442592757245-1.21607328704858
2550.555.66028773438430.441615487726866-3.93064842701421-0.647276116576455
2648.154.0173991153430.423337757501751-4.09893107506617-0.95745141010759
2758.754.59182229148140.4265584602467473.984898338012320.0661858454190987
285453.56273122104930.3937061238742521.63883702357988-0.646869717969869
2956.155.87234042100940.431978256949423-1.399380918822310.871665033531613
3060.455.90375415211210.4251806742073334.84354048535129-0.185180304537702
3151.255.12562491635740.40753460907217-2.86987058899475-0.561221199723659
3250.755.59167948890040.408304050185515-4.943349351736210.0274188324302579
3356.454.94601479011250.3955129877220592.38777761910336-0.495000302771469
3453.353.32547511596630.3730807857578811.76481470901880-0.948101104512396
3552.652.96281376559430.3663319655543500.292384820102349-0.346396265326864
3647.751.91759483799280.360300557721662-2.95175299722619-0.667564961315599
3749.552.05010930703930.361659253801339-2.34098209502258-0.110589336348128
3848.552.36823190271370.361391120771481-3.83003906323649-0.0202617188999141
3955.352.0622202399860.3515206565216223.79866147425206-0.300867366572693
4049.851.11984393368620.329266842405976-0.235467901674758-0.584259757644702
4157.453.80168865136680.3677566479429911.596710989042131.07693451108175
4264.656.20076838889420.3972616161301246.644761579297640.941276089190515
435356.56445501955150.396833113957337-3.53515562036393-0.0156816421068382
4441.553.11732815013380.353128277250413-8.2418979766742-1.80360053532200
4555.952.69788912836080.3452298328077713.8830523635093-0.363403968629055
4658.453.96970612899510.3535169473822053.611479628499060.436450342765258
4753.553.78342644081390.3497831027883960.194895942929942-0.254555779513232
4850.653.8099300731610.34866390722899-2.92201788178038-0.152980773781150
4958.556.32949129988270.3476535532622430.2198588681296531.03626506214856
5049.155.50767736495490.341245570942051-5.38179407121510-0.546431061873394
5161.156.19791457779840.3451606248484294.604116692041850.159767017226671
5252.355.64082983627450.332837940992319-2.57537673913724-0.412051704598823
5358.456.44103389841360.3392389918349581.559424270936380.215107328161140
5465.557.36107751759080.3465821834261347.637126424116120.269732110002818
5561.759.7507616724560.3697225648145090.1688610279882750.955299266811731
5645.157.93932767345840.347745408073652-10.9275216672941-1.02427063400410
5752.154.73016776543410.3161437522129480.499294035600076-1.6745044760329
5859.354.77864563722120.3141255205370274.75747062226951-0.126183068522801
5957.955.94423438571710.3190239545892631.202862140376560.401830949908647
604553.75037897677640.310296283456105-6.52122851060423-1.18842426686792
6164.957.2024120294330.3164175163079434.903750793101871.48885659181867
6263.861.90439780346010.339482792982958-1.949124122607822.05277376906402
6369.463.57576421121960.3516157724563154.676810141919600.615212032284827
6471.167.67760698429660.3937046153508830.2121715036983241.72659235314474
6562.966.33132119613220.373432710832944-1.93647182756971-0.804579225143055
6673.566.42340582150920.3703133062459147.32007982348669-0.130947420279429
6762.764.77182299965960.349867923716709-0.309872141465174-0.946344253981577
6851.963.52436791451220.335455565307162-10.2251337672085-0.750541928905227
6973.366.67086081014050.3576130827241624.157876295100251.32396538337305
7066.765.63390733444520.3483885937956382.29513311893782-0.657694490440457
7162.564.0792924538770.3386036845919100.101185287133001-0.898314217644751
7270.369.20234571095990.356066973006593-3.135195576160292.26093228719687
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/1hoow1261386508.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/1hoow1261386508.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/2844e1261386508.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/2844e1261386508.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/3s0xt1261386508.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/3s0xt1261386508.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/4mt4c1261386508.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/4mt4c1261386508.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/5vy3q1261386508.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/21/t126138725591saxannm69576p/5vy3q1261386508.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