Home » date » 2009 » Dec » 16 »

*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: Wed, 16 Dec 2009 07:18:57 -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/16/t1260973190zmhjwsrg6x6sogq.htm/, Retrieved Wed, 16 Dec 2009 15:19:57 +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/16/t1260973190zmhjwsrg6x6sogq.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 «
19915 19843 19761 20858 21968 23061 22661 22269 21857 21568 21274 20987 19683 19381 19071 20772 22485 24181 23479 22782 22067 21489 20903 20330 19736 19483 19242 20334 21423 22523 21986 21462 20908 20575 20237 19904 19610 19251 18941 20450 21946 23409 22741 22069 21539 21189 20960 20704 19697 19598 19456 20316 21083 22158 21469 20892 20578 20233 19947 20049
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
11991519915000
21984319843.9943178957-71.0878571363803-0.994317895669007-0.118782435020626
31976119760.7309832625-82.79602668467610.26901673746091-0.0197979137823644
42085820822.07852034641008.5146906316035.92147965359161.80930311820643
52196821973.6653171121145.05557553730-5.665317111981930.226651828859217
62306123064.75001113971093.53921294631-3.75001113973822-0.0855081607236897
72266122707.9502449778-290.808999241377-46.9502449778206-2.29777874350131
82226922262.8157970249-438.111539458916.18420297505747-0.244496714917772
92185721855.5771135006-408.6435652994051.422886499428030.0489117356031883
102156821565.2986171617-295.6647061171762.701382838319890.187525347244533
112127421275.6281967602-289.943191324189-1.628196760194850.00949672404276561
122098720987.8237163819-287.901802787922-0.8237163818640510.00338835156325109
131968319713.5671243585-1229.09328510059-30.5671243585169-1.56288797494588
141938119310.5884745786-440.18826518659770.41152542137851.31544285068647
151907119115.7896343943-211.956638228701-44.78963439425920.382814742405743
162077220656.37726587781417.39023402376115.6227341222092.70100817048867
172248522522.43573348421834.19199958307-37.43573348418310.691915353464615
182418124141.50930331621634.2847814599939.4906966838404-0.331810701648741
192347923624.4298294729-364.968905476902-145.429829472927-3.31841868158201
202278222775.8528421517-814.373498158816.14715784833346-0.74593380816506
212206722056.2694797685-726.28766210580110.73052023154120.146207240116577
222148921478.6668899565-588.11838222658910.33311004346000.2293370881841
232090320933.5700212574-548.139154619983-30.57002125740860.0663586319469552
242033020275.3975838953-650.38812623818154.6024161047364-0.169715975389280
251973619789.5287823-497.55170229978-53.5287823000060.253817091961421
261948319358.6951226839-435.517830545865124.3048773160610.103160025034256
271924219360.8158324495-34.3595406185888-118.8158324495190.669222744032911
282033420212.0385840219779.028274343585121.9614159780931.34931367886376
292142321503.31693496861248.84227704478-80.31693496862570.779813140841009
302252322377.3750178998904.978549369957145.624982100197-0.570766242281175
312198622155.8645338846-128.625359802679-169.864533884586-1.71560132897775
322146221477.5015573102-633.022576485718-15.5015573102070-0.837212478640571
332090820895.7119109632-586.01572558229812.28808903684170.0780232366798802
342057520556.1559478777-359.88405017702918.84405212232270.375339451984497
352023720254.9294447219-306.063858675002-17.92944472189360.0893324737880168
361990419868.3104800743-379.96973858059835.6895199256944-0.122671609575035
371961019643.4889262014-237.656303722162-33.48892620142130.236367687042846
381925119137.8444870749-483.583490040556113.155512925058-0.408410334452181
391894119081.9069836659-94.1583856891801-140.9069836659200.648006001669356
402045020312.19681775111114.45402029051137.8031822489112.00602414980104
412194622015.4320284251651.00213349906-69.43202842501290.890443159575436
422340923226.22704624251249.74236237062182.772953757488-0.666052638284688
432274122952.3107253375-139.244469042447-211.310725337477-2.30546715178198
442206922111.0188322956-779.231719801418-42.0188322955578-1.06226889600168
452153921523.7632597185-604.2288316279615.23674028150330.290474498005167
462118921158.6678057946-386.23592165702130.33219420542570.361830646819602
472096020961.7651676648-213.639583325585-1.765167664814490.286481276815693
482070420701.5272083712-256.1133256693082.47279162876521-0.0705004529366505
491969719728.6285921275-909.418221897572-31.6285921275245-1.08506379752044
501959819424.1086607690-358.094964831915173.8913392309550.915106239945355
511945619651.4821299626173.136185246543-195.4821299625650.882959553042894
522031620235.6739290013546.74631062888580.32607099870730.620273994884358
532108321160.3438615304889.878027274081-77.34386153039650.569405803683436
542215821880.0884890089735.391152201141277.911510991058-0.256435028722037
552146921665.6914020749-127.163385140742-196.691402074868-1.43168603319950
562089220968.7377564075-644.621381960067-76.7377564074897-0.858890526294234
572057820556.6979809134-433.40393198805321.30201908655550.350584443613076
582023320221.433729847-344.27838873054411.56627015301510.147933217242533
591994719964.3764038498-265.069359148595-17.37640384977800.131473536489530
602004919945.1468305703-41.8454646103689103.85316942970.370530374304483
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/1rpu21260973133.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/1rpu21260973133.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/28d6o1260973133.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/28d6o1260973133.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/3r8y91260973133.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/3r8y91260973133.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/4n6b41260973133.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/16/t1260973190zmhjwsrg6x6sogq/4n6b41260973133.ps (open in new window)


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