Home » date » 2009 » Dec » 02 »

*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, 02 Dec 2009 13:16:44 -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/02/t1259785080pt1hpkhb3fe7qsi.htm/, Retrieved Wed, 02 Dec 2009 21:18:25 +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/02/t1259785080pt1hpkhb3fe7qsi.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 «
17409 11514 31514 27071 29462 26105 22397 23843 21705 18089 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 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
 
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
11740917409000
21151412506.2913059122-244.387739386135-992.291305912165-1.02575576745848
33151425092.0483989720263.4559193206726421.951601027973.76129702035886
42707127652.2129060086302.462594822305-581.2129060086170.741875577877264
52946229050.3180734758311.562729471478411.6819265241720.355364829596963
62610527110.5237053057295.116204126061-1005.52370530575-0.729445538109279
72239723562.9421303995264.372364381204-1165.94213039951-1.24419095901657
82384323171.2353446991258.794670874886671.764655300916-0.212356228078968
92170522014.8067871875246.482159104604-309.806787187482-0.458005659444351
101808919115.2362452726218.841494314162-1026.23624527259-1.01803450880119
112076419741.6170308696222.4514355152691022.382969130420.131859719083486
122531623451.9675313528253.622583621371864.032468647171.12836445405244
131770420987.7645475884339.995907711357-3283.76454758839-0.976674646361794
141554821350.3355673948340.221565663245-5802.33556739480.00699642041598322
152802922150.6916096930350.7072674402265878.308390306970.138600590819406
162938327461.3429708618439.1512748213441921.657029138151.57609701786548
173643832980.9961770256495.5257357697073457.003822974411.64104499550511
183203432995.2004504311491.70721780234-961.200450431071-0.155627092140527
192267927228.8152803244445.706650485012-4549.81528032437-2.02217823630513
202431923951.9360236159416.94240254346367.063976384116-1.20227708216880
211800419245.3871065936374.523783314291-1241.38710659358-1.65448116236522
221753718338.7646718214363.548564422382-801.764671821442-0.413763642385118
232036619417.4341971657368.880213836674948.5658028343280.230803776638622
242278219857.9552832287369.0773686016612924.04471677130.0231366955959056
251916921581.0356239563362.788673990991-2412.035623956340.448329681305185
261380720963.9299932715356.229060112604-7156.92999327152-0.312401526011202
272974324394.844008536404.369508494355348.155991463970.95332870143285
282559125753.5233548705419.710702964736-162.5233548704710.301844145863279
292909625789.8036672149414.8294769518763306.19633278512-0.123231459848063
302648225505.0202581335407.88740658539976.97974186654-0.225707514196883
312240525465.3240553517403.974609611703-3060.32405535166-0.144413026627387
322704425071.3118895142397.0656878326751972.68811048584-0.257400474720513
331797021178.021495698358.987482530739-3208.02149569799-1.38367003912921
341873019966.7604933765345.493809491176-1236.76049337648-0.50618789646751
351968419136.3917322311337.246330197892547.608267768923-0.378656367123165
361978517904.5314534989330.7069080922561880.46854650105-0.506312571618937
371847919608.7327298361334.635187056392-1129.732729836070.445890115329529
381069819524.0990299617331.391787168035-8826.09902996174-0.133945274356414
393195624308.0969214647389.2640550203077647.903078535271.39988119559272
402950628166.3317945716439.6312560865591339.668205428361.09826822047231
413450630461.5796827833464.1203341044244044.420317216670.594305123307022
422716528128.7238796734432.466524820806-963.723879673433-0.900295610737329
432673628755.7281315107434.435342018757-2019.728131510700.0626797013560997
442369123498.5204122548379.494343463104192.479587745232-1.83369999111623
451815721292.4082253792355.157143192920-3135.40822537921-0.832689979903131
461732818991.8576227201331.757250943064-1663.85762272014-0.85453855715057
471820517557.7686653879318.433972507718647.231334612083-0.56779656990192
482099518658.8026655763323.2442763651392336.197334423660.252016929465789
491738218869.7802341722322.543282116104-1487.78023417223-0.0361841810728551
50936719849.1267170278328.428850430367-10482.12671702780.209801690485282
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/15p2c1259785002.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/15p2c1259785002.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/2x7lo1259785002.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/2x7lo1259785002.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/3tjhi1259785002.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/3tjhi1259785002.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/43ac71259785002.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/43ac71259785002.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/51giy1259785002.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259785080pt1hpkhb3fe7qsi/51giy1259785002.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = 0 ; par3 = 1 ; par4 = 1 ;
 
Parameters (R input):
par1 = 12 ; par2 = 0 ; par3 = 1 ; par4 = 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