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 10:48:33 -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/t1259862545padc3lf1dbrnoye.htm/, Retrieved Thu, 03 Dec 2009 18:49:12 +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/t1259862545padc3lf1dbrnoye.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 «
115.47 103.34 102.60 100.69 105.67 123.61 113.08 106.46 123.38 109.87 95.74 123.06 123.39 120.28 115.33 110.4 114.49 132.03 123.16 118.82 128.32 112.24 104.53 132.57 122.52 131.8 124.55 120.96 122.6 145.52 118.57 134.25 136.7 121.37 111.63 134.42 137.65 137.86 119.77 130.69 128.28 147.45 128.42 136.9 143.95 135.64 122.48 136.83 153.04 142.71 123.46 144.37 146.15 147.61 158.51 147.4 165.05 154.64 126.2 157.36 154.15 123.21 113.07 110.45 113.57 122.44 114.93 111.85 126.04 121.34
 
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
1115.47115.47000
2103.34107.327958564947-0.325179553534179-3.98795856494674-1.31384091634919
3102.6103.335702428143-0.531108494473806-0.735702428143354-0.626994004952887
4100.69101.477800279429-0.582071727486263-0.78780027942943-0.277578314861533
5105.67103.358480085691-0.5305688204010642.311519914308920.54103236586135
6123.61114.176046780436-0.3868933491131949.433953219564432.50565761915007
7113.08115.999701237838-0.363708685345868-2.91970123783790.487784846962114
8106.46111.601457500004-0.406517997994906-5.14145750000427-0.889343162668956
9123.38116.778244224018-0.3446805518181836.60175577598171.22986577501193
10109.87114.426950837446-0.367363045269992-4.55695083744614-0.441883426953570
1195.74104.474675073961-0.47567205218093-8.73467507396095-2.11065283575416
12123.06111.968804389118-0.38652258447178411.09119561088231.75506234544260
13123.39115.761408280578-0.4981893593515777.628591719422420.987641954012402
14120.28119.227540796823-0.5061999676160211.052459203177070.884476715828104
15115.33118.010039970474-0.520238922243998-2.68003997047408-0.144853501871608
16110.4115.656618777612-0.564656549838987-5.25661877761206-0.381198650923356
17114.49116.273380986845-0.541489489472847-1.783380986844870.255282991059217
18132.03119.676897405235-0.48740034234750812.35310259476490.866253538290777
19123.16122.752227021661-0.4518219744451560.4077729783390690.785280587709519
20118.82124.872475979880-0.429886337941507-6.052475979880470.56717228913698
21128.32122.470496177201-0.4461615345243735.84950382279913-0.434773043057902
22112.24117.393782083926-0.482434263437948-5.153782083926-1.02038976027460
23104.53116.47949329434-0.48496253223978-11.9494932943399-0.095073714820492
24132.57119.789924425355-0.47978343909462512.78007557464530.83685261990826
25122.52118.619278274337-0.4772479438178943.90072172566312-0.154085010070662
26131.8123.770050157323-0.4681738367146768.029949842676971.23641175510898
27124.55125.958475991532-0.440029360964334-1.408475991532180.565287481436237
28120.96127.091100751783-0.415541955356167-6.13110075178260.333279162886685
29122.6127.257181742023-0.406460463823326-4.657181742022720.125298946680323
30145.52131.126861504700-0.35045639865690314.39313849530040.934480534758247
31118.57125.780747762463-0.402289786662204-7.210747762463-1.09901390072755
32134.25130.762629209823-0.35688258826473.487370790176851.18700408177217
33136.7130.254959961601-0.3579510478818376.44504003839928-0.0332481632645142
34121.37128.303595820502-0.366972286446859-6.93359582050245-0.351062524363421
35111.63126.473888893507-0.372345045912592-14.8438888935066-0.32201849472247
36134.42124.058720669928-0.37541632784131810.3612793300721-0.45012444939853
37137.65129.866061576178-0.3703017110646137.78393842382191.36299362686532
38137.86131.537550056016-0.3632098617097596.322449943983640.44618146357317
39119.77127.165199857200-0.394911294055877-7.39519985720027-0.863858541840704
40130.69131.518977027508-0.341231395126340-0.8289770275082191.01856100287634
41128.28133.561342767946-0.311735769256841-5.281342767946250.514873768675007
42147.45132.764725227951-0.31732575714190114.6852747720485-0.105771942779876
43128.42135.154076773928-0.290757182740712-6.73407677392850.594353827488041
44136.9134.33399253471-0.2949985298399112.56600746529012-0.116568172349279
45143.95134.995478364977-0.2889259611929678.954521635023310.210740649050774
46135.64138.190665341355-0.272397667199056-2.550665341355180.767201469201027
47122.48138.254498853333-0.271316509184752-15.77449885333320.0739973500996006
48136.83134.148506177838-0.2796685828180512.68149382216241-0.843764540139479
49153.04139.038125773193-0.26751658154099414.00187422680661.13538098247071
50142.71137.994579852830-0.2706964749693414.71542014717033-0.169431413360703
51123.46135.677102722450-0.284477601915333-12.2171027224504-0.443468572362297
52144.37140.449551607447-0.2388819779448253.920448392552881.09224676117646
53146.15146.527074125742-0.175029283663729-0.3770741257423171.36894574101198
54147.61141.454574985447-0.2236194892936936.15542501455256-1.06825724005665
55158.51151.972920945210-0.1284743382267036.537079054790462.35575479203730
56147.4150.672578421736-0.137142283222423-3.27257842173574-0.257732805261729
57165.05153.743011841665-0.11835259890356911.30698815833530.706005605617627
58154.64155.669447008316-0.109317000949693-1.029447008316320.449957575074511
59126.2148.838105752518-0.131296583785884-22.6381057525176-1.47852021154116
60157.36151.710423859536-0.123164876041085.64957614046420.66017908858174
61154.15146.374999541500-0.138966201662437.77500045849982-1.14322064543085
62123.21132.103879576503-0.199355267159524-8.8938795765034-3.08655763456848
63113.07128.24269740184-0.221396367090524-15.1726974018401-0.79601403941959
64110.45118.437305427123-0.294314662373635-7.98730542712287-2.07908279108819
65113.57114.372258390693-0.326413110977238-0.802258390692765-0.819523877149432
66122.44117.268916504714-0.2988394220085915.171083495286050.703454687289402
67114.93113.484551149028-0.3262867800233211.44544885097167-0.763837738536676
68111.85114.51460613273-0.317123253986082-2.664606132730060.297982879869803
69126.04114.776303062257-0.31394856380701011.26369693774310.127282440685429
70121.34116.877827379219-0.3035571408383294.462172620781380.531164098880861
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862545padc3lf1dbrnoye/1t91j1259862510.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t1259862545padc3lf1dbrnoye/1t91j1259862510.ps (open in new window)


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


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


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


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