Home » date » 2010 » Dec » 21 »

*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: Tue, 21 Dec 2010 12:42:27 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve.htm/, Retrieved Tue, 21 Dec 2010 13:41:08 +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/2010/Dec/21/t1292935262ry9adwh7s7vd6ve.htm/},
    year = {2010},
}
@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 = {2010},
    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 «
104,31 103,88 103,88 103,86 103,89 103,98 103,98 104,29 104,29 104,24 103,98 103,54 103,44 103,32 103,3 103,26 103,14 103,11 102,91 103,23 103,23 103,14 102,91 102,42 102,1 102,07 102,06 101,98 101,83 101,75 101,56 101,66 101,65 101,61 101,52 101,31 101,19 101,11 101,1 101,07 100,98 100,93 100,92 101,02 101,01 100,97 100,89 100,62 100,53 100,48 100,48 100,47 100,52 100,49 100,47 100,44
 
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
1104.31104.31000
2103.88103.902294705550-0.0235502905421562-0.0222947055497816-1.68396802191647
3103.88103.902212705130-0.0230627915483656-0.02221270513050030.160576516216919
4103.86103.882202348102-0.0229743379049404-0.02220234810250300.0207960922739162
5103.89103.912029756396-0.0210390066673808-0.02202975639566810.358271067967188
6103.98104.001683756457-0.0161992955968004-0.02168375645651650.748215093703513
7103.98104.001635802637-0.0153894375142909-0.02163580263737370.108789580305062
8104.29104.3107262634100.00274825088015736-0.02072626340953792.17859634360554
9104.29104.3107334780460.0025810502502226-0.0207334780458504-0.0183507695207754
10104.24104.260862496924-0.000853205935104232-0.0208624969238806-0.350259632538984
11103.98104.001454362635-0.0187878521408545-0.0214543626347393-1.72266317912536
12103.54103.562346559576-0.0493539922474934-0.0223465595762711-2.79492399348178
13103.44103.293242011366-0.06056536377764510.146757988633870-1.73779670925153
14103.32103.331042251593-0.0519801085368243-0.01104225159338380.555141601417225
15103.3103.311022702522-0.0494380504621622-0.01102270252179950.211408498502653
16103.26103.271017400811-0.0486704764988985-0.01101740081123510.0623290479251919
17103.14103.151054148554-0.0545820478318245-0.0110541485537382-0.470664016636422
18103.11103.121042550360-0.0525127744926746-0.01104255035989810.162088201379941
19102.91102.921106203583-0.0650887714572062-0.0111062035831994-0.971916856400752
20103.23103.240954328097-0.0319019609830202-0.01095432809686092.53640811558381
21103.23103.240942840120-0.0291284056495086-0.01094284012031580.21003656624671
22103.14103.150962840525-0.0344591376692731-0.0109628405248079-0.40062819514297
23102.91102.921021428520-0.0516863719727084-0.0110214285201618-1.2865862156552
24102.42102.431141128595-0.0904939968173886-0.0111411285950175-2.88324803452654
25102.1102.041870481085-0.1157360249698860.05812951891548-2.14835894388426
26102.07102.073119677213-0.102383469934942-0.003119677212733930.881819353261513
27102.06102.063117251125-0.094121432454439-0.003117251125241530.60740502226227
28101.98101.983116912324-0.0928555399991643-0.003116912324194780.0928351410039142
29101.83101.833118160191-0.0979881685703347-0.00311816019072596-0.375634958031822
30101.75101.753117802721-0.096369889170432-0.003117802720608730.118234496644265
31101.56101.563119495771-0.104804432737705-0.00311949577064302-0.615381067835623
32101.66101.663116126409-0.0863345323848052-0.003116126409188141.34599737485727
33101.65101.653114983941-0.0794441640191125-0.003114983941291330.501656293120192
34101.61101.613114446924-0.0758810333994267-0.003114446924459350.259209976183802
35101.52101.523114621774-0.0771572452658088-0.00311462177353093-0.0927808640347435
36101.31101.313116118117-0.0891710819846183-0.00311611811704867-0.8729356750975
37101.19101.164255139333-0.09449476359399170.0257448606668044-0.416615268446897
38101.11101.111885695164-0.0906823212614798-0.001885695164347920.259491666821823
39101.1101.101891691181-0.0833773850690747-0.001891691180544320.530149371816324
40101.07101.071895291033-0.0785435153969892-0.001895291033187530.350729359183862
41100.98100.981894588374-0.0795812144845533-0.00189458837432693-0.0752769647514083
42100.93100.931896238314-0.0769014032168808-0.001896238314076260.194367357401417
43100.92100.921899631758-0.0708399077083481-0.001899631757645870.439581847152546
44101.02101.021907512070-0.0553595680164641-0.001907512069593261.12251338795001
45101.01101.011909414759-0.0512490306604136-0.001909414758686710.298036319387071
46100.97100.971909843856-0.0502295554935866-0.001909843855887710.0739118026397467
47100.89100.891908811178-0.0529277497666185-0.00190881117785979-0.195606237866223
48100.62100.621901963855-0.0726027157772648-0.00190196385523712-1.42626624398634
49100.53100.512961758190-0.07587566556209180.0170382418103744-0.249921541121885
50100.48100.481172369972-0.071893471025049-0.001172369972023150.275517192751225
51100.48100.481178342147-0.0653758733014334-0.001178342146496360.472369066887793
52100.47100.471182513954-0.0603556698666559-0.001182513954445560.36384159413811
53100.52100.521190074026-0.0503511181441277-0.001190074026502790.725080618390734
54100.49100.491191341815-0.0485061319441162-0.001191341815381840.133714907349267
55100.47100.471192956636-0.0459218215221221-0.001192956635600420.187296545105111
56100.44100.441193776809-0.0444783759456416-0.001193776809107510.104612640271396
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/1j9k01292935343.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/1j9k01292935343.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/2c01l1292935343.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/2c01l1292935343.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/3c01l1292935343.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/3c01l1292935343.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/449i61292935343.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/449i61292935343.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/549i61292935343.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292935262ry9adwh7s7vd6ve/549i61292935343.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