Home » date » 2009 » Dec » 03 »

SHW 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 11:46:26 -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/t1259866238yjqnw1ht40f15mh.htm/, Retrieved Thu, 03 Dec 2009 19:50:45 +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/t1259866238yjqnw1ht40f15mh.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 «
1.59 1.26 1.13 1.92 2.61 2.26 2.41 2.26 2.03 2.86 2.55 2.27 2.26 2.57 3.07 2.76 2.51 2.87 3.14 3.11 3.16 2.47 2.57 2.89 2.63 2.38 1.69 1.96 2.19 1.87 1.6 1.63 1.22 1.21 1.49 1.64 1.66 1.77 1.82 1.78 1.28 1.29 1.37 1.12 1.51 2.24 2.94 3.09 3.46 3.64 4.39 4.15 5.21 5.8 5.91 5.39 5.46 4.72 3.14 2.63
 
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
11.591.59000
21.261.27664147880926-0.0266130193168101-0.0166414788092608-0.468949884678013
31.131.14658931093672-0.0426786025786395-0.0165893109367155-0.240877315287619
41.921.936925022234500.124687571458184-0.0169250222344961.88692291413097
52.612.627100726337060.254193854788040-0.01710072633705951.25832718603289
62.262.276959026273870.105907435734632-0.0169590262738673-1.3305436525685
72.412.426966734195820.117134248415217-0.0169667341958190.0965066188707478
82.262.276932162973580.0477619711295369-0.0169321629735759-0.582691676530388
92.032.04690565090215-0.0251393727433627-0.0169056509021519-0.60473942082146
102.862.876965727790660.200585771877503-0.01696572779065971.85989902742832
112.552.566939354844820.0653946804138398-0.0169393548448212-1.10989283844115
122.272.28692624597294-0.0262094864032349-0.0169262459729372-0.750582012439315
132.262.12697237175659-0.06046112906687710.133027628243410-0.337207095851677
142.572.570831663788420.0668687993113224-0.0008316637884213120.915813897078617
153.073.071362312919330.182262255291627-0.00136231291932560.940473964105364
162.762.760919702401260.0512710137581165-0.000919702401255461-1.06909787240323
172.512.51072085498038-0.0288460150357446-0.000720854980381655-0.654378010343151
182.872.870909277159490.0745241277695391-0.000909277159490850.844648798105718
193.143.140978822585340.126479413233335-0.0009788225853405270.424625741548868
203.113.110937946485780.084893123708108-0.000937946485777381-0.339921207557084
213.163.160931253846340.0756203577080185-0.000931253846337647-0.0757992934482249
222.472.47082342847113-0.127835522174789-0.000823428471132048-1.66318697082964
232.572.57084698879969-0.0672914854001537-0.0008469887996948270.49493740251833
242.892.890876395858480.0356248234542288-0.0008763958584824920.841332090342454
252.632.66853365759167-0.0318862069520319-0.0385336575916663-0.605076419511567
262.382.38017806480123-0.0978198912733993-0.000178064801229533-0.500868009326136
271.691.68969848223087-0.2554861378377550.000301517769133157-1.28597155724411
281.961.9600108479324-0.115702053423195-1.08479324012053e-051.14132477664591
292.192.19016170671847-0.0237865087705708-0.0001617067184737850.750909991695025
301.871.87006680349765-0.102523516395460-6.68034976481764e-05-0.643444668015577
311.61.60002740683248-0.147034481757993-2.74068324820226e-05-0.363807147339418
321.631.63005798453742-0.0999868016240103-5.7984537419313e-050.384575132893068
331.221.22001866802329-0.182370793751421-1.86680232879242e-05-0.673452115812668
341.211.2100347193065-0.136565382413136-3.47193064986828e-050.374448371751139
351.491.49006320208605-0.0258695840351746-6.32020860464097e-050.904924553515611
361.641.640072031747430.0208647354352649-7.20317474337113e-050.382050202633907
371.661.659395662598890.02045926188457210.000604337401109234-0.00352566004978326
381.771.769110466553660.04360773959850690.0008895334463445460.179722773294015
391.821.819114298795700.04530880505208830.000885701204303930.0138826226222192
401.781.779076745019530.02262203729230130.000923254980471246-0.185294770867888
411.281.27890784215043-0.1163128344707830.00109215784956788-1.13523332962454
421.291.2889378142139-0.08274005204682160.001062185786101030.274384797902431
431.371.36896616726506-0.03948974623972750.001033832734940920.353520971912539
441.121.11893923805590-0.09543247652617850.00106076194410383-0.457297039205401
451.511.508984834283630.03356645554750190.001015165716367771.05452368023678
462.242.239032866438140.2186338437571570.0009671335618579261.51289389130264
472.942.939057243514610.3465489849828550.0009427564853943061.04569499849202
483.093.089049934963360.2943195711791340.000950065036642202-0.426973238420458
493.463.463217428233830.315381996492675-0.003217428233831470.180367079065923
503.643.640861745853410.279476808837663-0.000861745853407672-0.282076803703573
514.394.391085717519620.40465218755776-0.001085717519615511.02193085032645
524.154.150860450709180.233242722801421-0.00086045070917501-1.40025567161983
535.215.211072556674730.453010561917699-0.001072556674728071.79590027974623
545.85.801098360797650.489419394679731-0.001098360797649910.297579700584806
555.915.911045884683070.388586234884432-0.00104588468306820-0.824218253167346
565.395.390953615767780.147134300326672-0.000953615767782762-1.97375093812424
575.465.46094786418080.126636763850534-0.000947864180795105-0.167562034670224
584.724.72090041484098-0.103658824080971-0.00090041484098577-1.88263533275908
593.143.14084106305233-0.495971386420688-0.000841063052330742-3.20712861751377
602.632.63084064894165-0.49969923791476-0.000840648941646655-0.0304750686363817
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/1e44x1259865983.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/1e44x1259865983.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/3kdee1259865983.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/3kdee1259865983.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/471ak1259865983.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/471ak1259865983.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/59toq1259865983.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259866238yjqnw1ht40f15mh/59toq1259865983.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