Home » date » 2009 » Dec » 01 »

*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, 01 Dec 2009 12:03:49 -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/01/t1259694259ybdss1uo14wfyj6.htm/, Retrieved Tue, 01 Dec 2009 20:04:26 +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/01/t1259694259ybdss1uo14wfyj6.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 «
8.9 8.8 8.3 7.5 7.2 7.4 8.8 9.3 9.3 8.7 8.2 8.3 8.5 8.6 8.5 8.2 8.1 7.9 8.6 8.7 8.7 8.5 8.4 8.5 8.7 8.7 8.6 8.5 8.3 8 8.2 8.1 8.1 8 7.9 7.9 8 8 7.9 8 7.7 7.2 7.5 7.3 7 7 7 7.2 7.3 7.1 6.8 6.4 6.1 6.5 7.7 7.9 7.5 6.9 6.6 6.9
 
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
18.98.9000
28.88.80116511062432-0.0989311795123792-0.00116511062431548-0.282751620481151
38.38.3111650143321-0.477189480934895-0.0111650143321000-1.09234441260947
47.57.50640511938206-0.791631310115204-0.00640511938205747-0.892873240433318
57.27.18503514599877-0.3399646789600450.01496485400122711.28373061268300
67.47.388638292049520.1821805917986530.01136170795047951.48396631035935
78.88.771029592258231.335066580762450.02897040774177153.27656850899902
89.39.330217289642430.589784159016862-0.0302172896424309-2.11813549261455
99.39.311612596811230.00538604414095833-0.0116125968112328-1.6608930432081
108.78.71268521128293-0.575097457634592-0.0126852112829362-1.64976748750803
118.28.1944642782976-0.5204637522347790.005535721702392260.155272131963560
128.38.283878861341050.06536517031815950.01612113865894561.66495948069117
138.58.49947320465330.2096335424485090.0005267953467059180.410171625509456
148.68.603027242874490.10769334662923-0.00302724287448834-0.290885332876739
158.58.49939254551501-0.09063084823382430.000607454484992285-0.56915629633319
168.28.22114002512543-0.266503472689155-0.0211400251254290-0.499275050458061
178.18.06859506650381-0.1597294994553140.03140493349618820.303494460607542
187.97.9504542607466-0.120752516451051-0.05045426074659750.110774490408360
198.68.523016949399010.5290226621806140.07698305060098971.84670003104847
208.78.741716343712090.238192770378631-0.0417163437120898-0.826555246652197
218.78.69897726508716-0.02509181563243620.00102273491284020-0.748269937356021
228.58.50556690768398-0.182837382859991-0.00556690768397682-0.448321976087315
238.48.4088918022782-0.102086748566112-0.00889180227819240.229498022688034
248.58.484404808371690.06435450887900360.01559519162831080.47303647532219
258.78.69477211954640.2011588351894450.00522788045360090.388981265434598
268.78.707179413194440.0241738054931103-0.00717941319444131-0.503921089884762
278.68.59185891650277-0.1048633390658380.00814108349722883-0.368581482019345
288.58.52267464327635-0.0718135929079912-0.02267464327634770.0938686093731788
298.38.256898445496-0.2512827736983540.0431015545040007-0.510083273041614
3088.09768740595025-0.166063730839384-0.09768740595025240.242199854442588
318.28.10462034736826-0.00593775042036590.09537965263173950.455087165429725
328.18.130362002156470.0233841422091786-0.03036200215646760.0833345244824027
338.18.09014705982349-0.03548156382356870.0098529401765114-0.167299726482142
3488.00655886836528-0.0800081143337638-0.00655886836527993-0.126547020089523
357.97.9148843387258-0.090806451314017-0.0148843387257907-0.0306895626239415
367.97.8960375512163-0.02420533651832390.003962448783704230.189284883186909
3787.98135922802080.07714585924536210.01864077197920000.288205654434986
3888.000609647753320.0235476075564089-0.000609647753322567-0.152418334971885
397.97.90799502759682-0.0831752697023524-0.00799502759681478-0.304111733842731
4087.994797067208540.07326715575668580.005202932791458920.444540005722395
417.77.67793272093754-0.285370643212750.0220672790624626-1.01918476015459
427.27.31235165181671-0.359125510900463-0.112351651816708-0.209622129067310
437.57.385142156819450.03805528935802570.1148578431805491.12880724109671
447.37.3338869911354-0.0440714939602683-0.0338869911353984-0.233409192515345
4577.00332994115018-0.307510243260277-0.00332994115017805-0.748708086482017
4676.98591465417594-0.0407501063096030.01408534582405690.758147806048401
4777.012935557067170.0215699729508071-0.01293555706717170.177117933216027
487.27.199209106145850.1730108444706070.000790893854154660.430409039622866
497.37.284696874956220.09254188314712680.0153031250437844-0.228827733082672
507.17.1033193555692-0.159316911146325-0.00331935556920586-0.715843643918503
516.86.84155945681376-0.253084869175999-0.0415594568137613-0.266886673704591
526.46.3722661816598-0.4512924294415360.0277338183402029-0.563372996812719
536.16.04811626816333-0.334852336584520.05188373183667390.330873375589449
546.56.605799686063850.482676445456254-0.1057996860638492.32356290755763
557.77.564060665440860.918336944209580.1359393345591411.23816733332057
567.97.934299324249640.416252565729041-0.0342993242496419-1.42695310587975
577.57.56597644032848-0.302447461947194-0.0659764403284789-2.04258685254906
586.96.90093570241678-0.63459888729584-0.000935702416784052-0.943994372545665
596.66.60725402942677-0.322304655662228-0.007254029426769140.88756062858964
606.96.869279171806450.2128980580940260.03072082819355221.52112584256506
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/1q2421259694227.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/1q2421259694227.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/2bj9t1259694227.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/2bj9t1259694227.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/3homh1259694227.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/3homh1259694227.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/427u31259694227.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/01/t1259694259ybdss1uo14wfyj6/427u31259694227.ps (open in new window)


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