Home » date » 2009 » Dec » 03 »

Ad hoc forecasting 2

*The author of this computation has been verified*
R Software Module: /rwasp_decomposeloess.wasp (opens new window with default values)
Title produced by software: Decomposition by Loess
Date of computation: Thu, 03 Dec 2009 10:20:44 -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/t12598609304yhq6grx3bff63i.htm/, Retrieved Thu, 03 Dec 2009 18:22:15 +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/t12598609304yhq6grx3bff63i.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:
Uitleg in Word document
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
96.96 93.11 95.62 98.30 96.38 100.82 99.06 94.03 102.07 99.31 98.64 101.82 99.14 97.63 100.06 101.32 101.49 105.43 105.09 99.48 108.53 104.34 106.10 107.35 103.00 104.50 105.17 104.84 106.18 108.86 107.77 102.74 112.63 106.26 108.86 111.38 106.85 107.86 107.94 111.38 111.29 113.72 111.88 109.87 113.72 111.71 114.81 112.05 111.54 110.87 110.87 115.48 111.63 116.24 113.56 106.01 110.45 107.77 108.61 108.19
 
Output produced by software:


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


Seasonal Decomposition by Loess - Parameters
ComponentWindowDegreeJump
Seasonal601061
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
196.9698.8618114181477-1.5322815802507896.5904701621031.90181141814772
293.1191.8544777226643-2.4806778853822996.846200162718-1.25552227733567
395.6295.7251456883997-1.5870758517325897.10193016333290.105145688399716
498.398.63325799270740.59890114281989797.36784086447270.333257992707374
596.3895.5433670503845-0.41711861599708997.6337515656126-0.836632949615492
6100.82100.6624423656033.0713495893990797.9062080449982-0.157557634397293
799.0698.54351625747941.3978192181367498.1786645243839-0.516483742520592
894.0393.3758600506391-3.7767871845230998.460927133884-0.654139949360896
9102.07102.2482038124303.1486064441860598.74318974338410.178203812429828
1099.31100.131994975942-0.60154290044197199.08954792450030.82199497594165
1198.6497.0677838155770.7763100788065399.4359061056165-1.57221618442307
12101.82102.3903318964161.4024965837484699.84717151983560.570331896415908
1399.1499.553844646196-1.53228158025078100.2584369340550.413844646196054
1497.6397.0152417303699-2.48067788538229100.725436155012-0.61475826963013
15100.06100.514640475762-1.58707585173258101.1924353759700.454640475762474
16101.32100.3473414437940.598901142819897101.693757413386-0.972658556205516
17101.49101.202039165196-0.417118615997089102.195079450801-0.287960834804039
18105.43105.0990075929813.07134958939907102.689642817620-0.330992407018726
19105.09105.5979745974251.39781921813674103.1842061844380.507974597425076
2099.4899.0937544083436-3.77678718452309103.643032776179-0.386245591656404
21108.53109.8095341878933.14860644418605104.1018593679211.27953418789318
22104.34104.795275661898-0.601542900441971104.4862672385440.455275661897829
23106.1106.5530148120260.77631007880653104.8706751091680.453014812025941
24107.35108.1421619749161.40249658374846105.1553414413350.79216197491641
25103102.092273806748-1.53228158025078105.440007773503-0.907726193251946
26104.5105.804956072695-2.48067788538229105.6757218126871.30495607269529
27105.17106.015639999861-1.58707585173258105.9114358518710.845639999861305
28104.84102.9322151198810.598901142819897106.148883737299-1.90778488011925
29106.18106.390786993270-0.417118615997089106.3863316227270.210786993269650
30108.86107.9836764120983.07134958939907106.664973998503-0.876323587901837
31107.77107.1985644075851.39781921813674106.943616374278-0.571435592414815
32102.74101.979251762594-3.77678718452309107.277535421929-0.760748237405807
33112.63114.4999390862343.14860644418605107.6114544695801.86993908623427
34106.26105.104272534902-0.601542900441971108.017270365539-1.15572746509751
35108.86108.5206036596940.77631007880653108.423086261499-0.339396340305825
36111.38112.5147603463101.40249658374846108.8427430699411.13476034631044
37106.85105.969881701868-1.53228158025078109.262399878383-0.880118298132132
38107.86108.552889406246-2.48067788538229109.6477884791370.692889406245598
39107.94107.433898771842-1.58707585173258110.033177079890-0.506101228157888
40111.38111.7775491054770.598901142819897110.3835497517030.397549105476799
41111.29112.263196192481-0.417118615997089110.7339224235160.97319619248094
42113.72113.3292826001903.07134958939907111.039367810411-0.390717399810171
43111.88111.0173675845571.39781921813674111.344813197306-0.862632415442775
44109.87111.908825413066-3.77678718452309111.6079617714572.03882541306633
45113.72112.4202832102063.14860644418605111.871110345607-1.29971678979351
46111.71111.930453620389-0.601542900441971112.0910892800530.220453620389435
47114.81116.5326217066960.77631007880653112.3110682144981.72262170669589
48112.05110.2658985145541.40249658374846112.431604901698-1.78410148544617
49111.54112.060139991353-1.53228158025078112.5521415888980.520139991352934
50110.87111.771958629940-2.48067788538229112.4487192554430.901958629939585
51110.87110.981778929745-1.58707585173258112.3452969219880.111778929745029
52115.48118.4928842858250.598901142819897111.8682145713553.01288428582498
53111.63112.285986395274-0.417118615997089111.3911322207230.655986395274383
54116.24118.5041027103433.07134958939907110.9045477002582.26410271034305
55113.56115.3042176020701.39781921813674110.4179631797931.74421760207022
56106.01105.895091242703-3.77678718452309109.901695941820-0.114908757297286
57110.45108.3659648519663.14860644418605109.385428703848-2.08403514803375
58107.77107.317813537045-0.601542900441971108.823729363397-0.452186462955069
59108.61108.1816598982470.77631007880653108.262030022946-0.428340101752909
60108.19107.3092647717791.40249658374846107.668238644473-0.88073522822144
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/03/t12598609304yhq6grx3bff63i/1yjpy1259860842.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t12598609304yhq6grx3bff63i/1yjpy1259860842.ps (open in new window)


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


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


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


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1) #seasonal period
if (par2 != 'periodic') par2 <- as.numeric(par2) #s.window
par3 <- as.numeric(par3) #s.degree
if (par4 == '') par4 <- NULL else par4 <- as.numeric(par4)#t.window
par5 <- as.numeric(par5)#t.degree
if (par6 != '') par6 <- as.numeric(par6)#l.window
par7 <- as.numeric(par7)#l.degree
if (par8 == 'FALSE') par8 <- FALSE else par9 <- TRUE #robust
nx <- length(x)
x <- ts(x,frequency=par1)
if (par6 != '') {
m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.window=par6, l.degree=par7, robust=par8)
} else {
m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.degree=par7, robust=par8)
}
m$time.series
m$win
m$deg
m$jump
m$inner
m$outer
bitmap(file='test1.png')
plot(m,main=main)
dev.off()
mylagmax <- nx/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(as.numeric(m$time.series[,'trend']),na.action=na.pass,lag.max = mylagmax,main='Trend')
acf(as.numeric(m$time.series[,'seasonal']),na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(as.numeric(m$time.series[,'remainder']),na.action=na.pass,lag.max = mylagmax,main='Remainder')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend')
spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal')
spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend')
cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal')
cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Seasonal Decomposition by Loess - Parameters',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Component',header=TRUE)
a<-table.element(a,'Window',header=TRUE)
a<-table.element(a,'Degree',header=TRUE)
a<-table.element(a,'Jump',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,m$win['s'])
a<-table.element(a,m$deg['s'])
a<-table.element(a,m$jump['s'])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Trend',header=TRUE)
a<-table.element(a,m$win['t'])
a<-table.element(a,m$deg['t'])
a<-table.element(a,m$jump['t'])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Low-pass',header=TRUE)
a<-table.element(a,m$win['l'])
a<-table.element(a,m$deg['l'])
a<-table.element(a,m$jump['l'])
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Seasonal Decomposition by Loess - Time Series Components',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,'Fitted',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Trend',header=TRUE)
a<-table.element(a,'Remainder',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,x[i]+m$time.series[i,'remainder'])
a<-table.element(a,m$time.series[i,'seasonal'])
a<-table.element(a,m$time.series[i,'trend'])
a<-table.element(a,m$time.series[i,'remainder'])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.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