Home » date » 2009 » Dec » 03 »

*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 13:11:45 -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/03/t1259871174uu1144d3bfixbcn.htm/, Retrieved Thu, 03 Dec 2009 21:13:00 +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/03/t1259871174uu1144d3bfixbcn.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 «
1915 1843 1761 2858 3968 5061 4661 4269 3857 3568 3274 2987 1683 1381 1071 2772 4485 6181 5479 4782 4067 3489 2903 2330 1736 1483 1242 2334 3423 4523 3986 3462 2908 2575 2237 1904 1610 1251 941 2450 3946 5409 4741 4069 3539 3189 2960 2704 1697 1598 1456 2316 3083 4158 3469 2892 2578 2233 1947 2049
 
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
119151915000
218431843.99431779336-71.0878572278306-0.994317793362496-0.118782434738233
317611760.73098327906-82.79602661632550.269016720944476-0.0197979134286433
428582822.078522541981008.5146958664635.92147745802351.80930312201797
539683973.665316975581145.05557395077-5.665316975581360.226651816858512
650615064.750010769451093.53921250168-3.75001076945432-0.0855081585733372
746614707.95024201491-290.809005748789-46.9502420149081-2.29777874671134
842694262.81579709793-438.1115372845176.18420290207231-0.244496699778275
938573855.57711371601-408.6435649790291.422886283987230.048911732379963
1035683565.2986173083-295.6647058406612.701382691700440.187525346612445
1132743275.62819664525-289.943191544671-1.628196645254960.00949672318951281
1229872987.82371629392-287.901802766272-0.8237162939170270.00338835195504231
1316831713.56712235695-1229.09328966190-30.5671223569538-1.56288797789183
1413811310.58847923549-440.18825673155270.41152076451261.31544286775096
1510711115.78963292764-211.956642260241-44.78963292764470.382814720271252
1627722656.377270821581417.3902456518115.6227291784162.70100818871470
1744854522.435732912381834.19199689547-37.4357329123780.69191532764831
1861816141.509304928091634.2847825375639.4906950719122-0.331810694409317
1954795624.42982228918-364.968921181233-145.429822289177-3.3184186995403
2047824775.8528407719-814.373495587366.14715922809708-0.745933775605698
2140674056.26948079706-726.28765935037410.73051920294500.14620723998589
2234893478.66689042194-588.1183820288310.33310957805540.229337083254824
2329032933.57001990285-548.139156145035-30.57001990285070.0663586288894683
2423302275.39758623601-650.38812330166954.6024137639919-0.169715967477611
2517361789.52878030154-497.551705537405-53.52878030154090.253817080946218
2614831358.69512767047-435.517824043713124.3048723295330.103160040904261
2712421360.81582933842-34.3595457358069-118.8158293384190.669222722740359
2823342212.03858623321779.028281892274121.9614137667881.34931369578257
2934233503.316934503721248.84227706923-80.3169345037240.779813126068055
3045234377.37502345757904.978553551751145.624976542429-0.570766233674772
3139864155.86452813121-128.625373867469-169.864528131208-1.71560135414889
3234623477.50155379676-633.02257755839-15.5015537967614-0.837212454578822
3329082895.71191154208-586.01572173247212.28808845791880.0780232446176738
3425752556.15594892908-359.88404854333718.84405107092480.375339447186656
3522372254.92944466363-306.063859348415-17.92944466363450.0893324696921452
3619041868.31048068351-379.96973831263435.6895193164873-0.122671607646575
3716101643.48892647039-237.656303453972-33.48892647038980.236367686330915
3812511137.84448956637-483.583488938503113.155510433633-0.408410331825218
399411081.90698047364-94.1583891589908-140.9069804736390.648005992213137
4024502312.196818808341114.45402849545137.803181191662.00602416300433
4139464015.432030566381651.00213730320-69.43203056637940.890443149671629
4254095226.227052132351249.74236455958182.772947867653-0.66605263897509
4347414952.31071987489-139.244484583548-211.310719874888-2.30546717433684
4440694111.01882682801-779.231723660451-42.0188268280059-1.06226887344331
4535393523.76325955734-604.22882645321815.23674044265650.290474512133344
4631893158.66780754494-386.23591861163330.33219245506220.361830642206055
4729602961.76516842858-213.639583286423-1.765168428584390.286481270971357
4827042701.5272080579-256.1133268127282.47279194210022-0.0705004546891371
4916971728.62859318626-909.41822328979-31.6285931862648-1.08506379466651
5015981424.10866382671-358.094960988995173.891336173290.915106245886558
5114561651.48212534320173.136180758787-195.4821253432030.882959536644735
5223162235.67392653673546.74631362066980.3260734632670.620274005397241
5330833160.34386444056889.878033750948-77.34386444056080.56940580779805
5441583880.08849755857735.391157317516277.911502441432-0.256435030215154
5534693665.69139932732-127.163398260822-196.691399327316-1.43168605919819
5628922968.73774976568-644.62138869767-76.7377497656808-0.858890513139222
5725782556.69797954254-433.40392700530421.30202045746050.350584462021206
5822332221.43373046111-344.27838612627211.56626953889400.147933212853412
5919471964.37640494239-265.069358169029-17.37640494238580.1314735334007
6020491945.14683438854-41.8454611812789103.8531656114570.370530377263508
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/15xbu1259871102.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/15xbu1259871102.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/2xopp1259871102.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/2xopp1259871102.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/36zgp1259871102.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/36zgp1259871102.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/4ryr01259871102.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/4ryr01259871102.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/5d76l1259871102.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259871174uu1144d3bfixbcn/5d76l1259871102.ps (open in new window)


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