Home » date » 2009 » Dec » 04 »

*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: Fri, 04 Dec 2009 15:45:35 -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/04/t12599667697p4lsr6xcxhkbej.htm/, Retrieved Fri, 04 Dec 2009 23:46:16 +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/04/t12599667697p4lsr6xcxhkbej.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 «
102.80 118.72 119.01 118.61 120.43 111.83 116.79 131.71 120.57 117.83 130.80 107.46 112.09 129.47 119.72 134.81 135.80 129.27 126.94 153.45 121.86 133.47 135.34 117.10 120.65 132.49 137.60 138.69 125.53 133.09 129.08 145.94 129.07 139.69 142.09 137.29 127.03 137.25 156.87 150.89 139.14 158.30 149.00 158.36 168.06 153.38 173.86 162.47 145.17 168.89 166.64 140.07 128.84 123.40 120.30 129.66 118.12 113.91 131.09 119.14 115.33
 
Output produced by software:


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


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1102.8102.8000
2118.72114.7820345326040.5447487312076293.937965467395911.5016766394609
3119.01118.5741368086360.7059074207108520.4358631913636830.495975304070011
4118.61118.9000913175160.695319232732628-0.290091317515946-0.0681451771864634
5120.43119.613538736120.6955644387625090.8164612638800880.00332412911584292
6111.83115.0160641127540.648418697856438-3.18606411275436-0.970778696005901
7116.79115.0254312810530.6429501852060621.7645687189466-0.117094027564651
8131.71124.4593796320540.722804864643187.250620367946181.60967624902769
9120.57123.6150596632300.708074067210482-3.04505966323035-0.286868722278071
10117.83119.8907201014320.666215185027466-2.06072010143239-0.81133923800776
11130.8125.3282825543350.7108975485425525.471717445664720.87339948572819
12107.46115.7116067893590.615255630219125-8.2516067893593-1.89050218102496
13112.09116.5830584237000.607490411114577-4.493058423699810.0510342840132408
14129.47122.7659320738760.6192694249419196.704067926123781.01190798118922
15119.72121.9107228278360.588250625414513-2.19072282783557-0.248991663922578
16134.81129.0659635257720.7272754738944575.744036474228321.15623667828975
17135.8132.2125307019970.7626973064584083.587469298002720.439502884174452
18129.27133.3467728748740.76617471395629-4.076772874874190.0680170372315233
19126.94131.3258466296450.746672121187336-4.38584662964456-0.510570456047832
20153.45138.9195426019820.79167388529234714.53045739801821.25387560409885
21121.86131.8913865981530.737887976018393-10.0313865981526-1.43166863199556
22133.47133.6315712632710.74475163822905-0.1615712632710320.183481242284209
23135.34129.5453079067260.7200591023336325.79469209327393-0.883680351298068
24117.1127.0945289154160.719273405955426-9.9945289154161-0.580831637602893
25120.65127.1953223530990.722912945226276-6.5453223530992-0.115157656244479
26132.49126.7650550458640.72086147232265.72494495413641-0.209927933061647
27137.6135.9955178945050.8184175056201691.604482105495221.49852549191873
28138.69136.3943044061910.8121932343058782.29569559380864-0.0743664294146008
29125.53128.9591815821180.704504396803709-3.42918158211757-1.48991514546401
30133.09132.5728363607360.7331469945559630.517163639264170.531001088891679
31129.08135.0463685113770.746179540549839-5.966368511376860.318647598837167
32145.94131.8496282769730.72114833805477314.0903717230267-0.722314456937508
33129.07135.4762916727580.737955989005935-6.406291672758330.532171132341931
34139.69137.1084385939370.7423186591068172.581561406062990.163656817599235
35142.09136.2437800803470.737583717696585.84621991965328-0.293861994751582
36137.29142.2346275158240.739370102049005-4.944627515823870.962092945867542
37127.03138.9986041059680.741899592003961-11.9686041059682-0.729692373070082
38137.25136.7524440213690.7332278508018480.497555978630793-0.542397067167401
39156.87146.1444202366870.8028692680899910.72557976331321.54729566526100
40150.89147.1007104355790.804557807251813.789289564421450.0274038640410396
41139.14145.7851478647670.78117756767927-6.64514786476734-0.382662049098098
42158.3152.5074777989690.8370451135278885.79252220103111.08207086121228
43149154.1796028082300.84337304623839-5.179602808230450.152748209699735
44158.36150.0578628664590.8127259312450718.30213713354111-0.909344153241108
45168.06163.0937763836570.8745020328128534.966223616343132.23825741702652
46153.38158.3260423723780.85298069557824-4.94604237237773-1.03229841976618
47173.86164.1596884823210.8644406648310469.700311517678640.910697185743786
48162.47165.9333177448390.865389121029962-3.463317744838590.166306046825845
49145.17161.6964633001590.859302748582286-16.5264633001589-0.932198631889592
50168.89167.2832530400110.8754479015933021.606746959989220.85760666420435
51166.64162.0339886962050.8354336788805794.60601130379523-1.10152246408654
52140.07147.4588182885670.700375631719434-7.3888182885675-2.76787906597551
53128.84140.8214673726550.631944763271959-11.9814673726553-1.32571240749699
54123.4127.7101997954700.514198440616602-4.31019979547042-2.50033714604736
55120.3124.7226610069330.488827737971778-4.42266100693287-0.639845405386887
56129.66125.4445254222250.4901982165032494.215474577775130.0426505253904493
57118.12118.1837077203280.454524092001214-0.0637077203279084-1.41857192826512
58113.91119.1425526793750.456216491416185-5.232552679374840.092236304904101
59131.09120.6475760619410.45854740133622810.44242393805920.191717538727549
60119.14121.0387437522050.458439809244851-1.89874375220497-0.0123122287647229
61115.33127.4485290874000.470400364217843-12.11852908740051.08536045198542
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/1e76l1259966732.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/1e76l1259966732.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/2a77t1259966732.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/2a77t1259966732.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/3gqzi1259966732.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/3gqzi1259966732.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/44sft1259966732.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/44sft1259966732.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/5a6qo1259966732.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599667697p4lsr6xcxhkbej/5a6qo1259966732.ps (open in new window)


 
Parameters (Session):
par1 = 36 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = MA ; par7 = 0.95 ;
 
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = MA ; par7 = 0.95 ;
 
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