Home » date » 2010 » Dec » 17 »

Model 1: Classical decomposition van tijdreeksen

*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, 17 Dec 2010 10:48:09 +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/17/t1292582825v7ufrnvuoue6r1s.htm/, Retrieved Fri, 17 Dec 2010 11:47:06 +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/17/t1292582825v7ufrnvuoue6r1s.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 «
101.76 102.37 102.38 102.86 102.87 102.92 102.95 103.02 104.08 104.16 104.24 104.33 104.73 104.86 105.03 105.62 105.63 105.63 105.94 106.61 107.69 107.78 107.93 108.48 108.14 108.48 108.48 108.89 108.93 109.21 109.47 109.80 111.73 111.85 112.12 112.15 112.17 112.67 112.80 113.44 113.53 114.53 114.51 115.05 116.67 117.07 116.92 117.00 117.02 117.35 117.36 117.82 117.88 118.24 118.50 118.80 119.76 120.09
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Structural Time Series Model
tObservedLevelSlopeSeasonalStand. Residuals
1101.76101.76000
2102.37102.3174727183420.03471859712575290.05252728165823381.21653408394008
3102.38102.3630967031790.03537099730169110.01690329682065210.0374807288615759
4102.86102.7660121380150.06182676737229940.0939878619848371.26006628543763
5102.87102.8565259944150.06439381666904920.01347400558517070.0970614551395525
6102.92102.8951441926220.06170220279539320.0248558073779502-0.0863355542135141
7102.95102.9232664054440.05780779366528060.0267335945557088-0.111558917578599
8103.02102.986360779630.05846742451396740.03363922037034320.017449553371332
9104.08103.906384008720.1716865644396230.1736159912795552.82958576258916
10104.16104.1623516541420.183178957970156-0.002351654142048810.275755218128024
11104.24104.2311110631310.1671597392288730.00888893686904191-0.373300151584694
12104.33104.3064022254160.1540526846112070.0235977745844905-0.299090948647967
13104.73104.8604695943020.207117411890546-0.1304695943022741.47412309781891
14104.86104.8566365964680.1762374371836580.00336340353179794-0.61391938697607
15105.03105.0690259508530.181514555098871-0.03902595085279050.114470266103365
16105.62105.4947327953420.2172886463078360.1252672046575310.786668310554586
17105.63105.6575631370210.209287094648009-0.0275631370206787-0.174805076269677
18105.63105.6520314245690.17763982941347-0.0220314245687912-0.689462488532367
19105.94105.8811914927090.1852458720123120.05880850729134970.165392890227162
20106.61106.5980754026210.2638490962277190.01192459737894981.70670020285572
21107.69107.4500041252310.3508891389405550.239995874769211.88783100840636
22107.78107.8200148131840.353721699690585-0.04001481318395140.0613901764090433
23107.93107.971538109960.323756401892095-0.0415381099602706-0.649034296102
24108.48108.4741799450540.3501960442388440.005820054946153990.573277064926967
25108.14108.369835684750.283469851836746-0.229835684750324-1.52703398147439
26108.48108.5025594204560.261203837856906-0.0225594204562057-0.466573400302342
27108.48108.5958409474020.2365189597646-0.115840947401956-0.528806541071097
28108.89108.7540774839450.2249630059310330.135922516054989-0.250963502594185
29108.93108.9060085561630.2141619266081190.023991443836591-0.233533413380494
30109.21109.1950674503710.2252389482152280.01493254962878040.239287207581077
31109.47109.4916419592380.235788138049671-0.021641959237870.228009899219974
32109.8109.872496921270.257240968772351-0.07249692126989660.463856853136858
33111.73111.2279365596470.4196562022539940.502063440352693.51250250747222
34111.85111.8670746259920.452117757985171-0.01707462599206470.702089726930494
35112.12112.2490112902070.441743034536639-0.129011290206952-0.224285673307821
36112.15112.1889712006210.367730337746188-0.0389712006213954-1.60540473445718
37112.17112.3901985305120.343180227978755-0.22019853051239-0.544259583429246
38112.67112.6630554645340.332801799953530.00694453546573659-0.221512032443065
39112.8112.9087843448470.320004833533807-0.108784344847394-0.274447825358123
40113.44113.2630231140460.3250479476868110.1769768859541670.109440013056598
41113.53113.5193252068730.3148991088208570.010674793126677-0.219640800811456
42114.53114.3620286136530.392839136602560.1679713863472781.68370953206525
43114.51114.6179115852480.372618191763011-0.107911585248089-0.436936613034195
44115.05115.2849145647480.416080409316406-0.2349145647478620.939601821048872
45116.67116.1314668851960.4796365306895330.5385331148038611.37440659450527
46117.07117.0003159571380.5370972672949330.06968404286174931.24250556479722
47116.92117.085593724150.470440601665885-0.165593724150122-1.44086873152366
48117117.1083787473570.404494399090913-0.108378747357085-1.43164644904341
49117.02117.2706616578090.368784058769506-0.250661657809041-0.782605866684855
50117.35117.3729157783270.329478226036952-0.022915778327269-0.844391729488189
51117.36117.4976600050160.299379264506053-0.137660005016105-0.646510140041732
52117.82117.6492553995680.2776315361470890.170744600431516-0.471422125078926
53117.88117.9503404274910.281089309001206-0.07034042749137360.0748875130991198
54118.24118.0703874043510.2573353500694550.169612595649055-0.513390879686081
55118.5118.5966883097040.297004046873483-0.09668830970415170.857194639883577
56118.8119.102877514440.327853732568275-0.3028775144402610.666895154373479
57119.76119.3481025852060.3156680206190730.411897414793714-0.263489131274974
58120.09119.8733753278280.3465744099105980.2166246721724570.668167654188408
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/1x2o11292582885.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/1x2o11292582885.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/28bnn1292582885.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/28bnn1292582885.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/38bnn1292582885.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/38bnn1292582885.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/40km71292582885.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/40km71292582885.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/50km71292582885.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/17/t1292582825v7ufrnvuoue6r1s/50km71292582885.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