Home » date » 2009 » Dec » 05 »

WS 8: Exponential Smoothing

*The author of this computation has been verified*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Fri, 04 Dec 2009 16:46:53 -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/05/t1259970471n5v5bqgx9oyn6op.htm/, Retrieved Sat, 05 Dec 2009 00:47:55 +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/05/t1259970471n5v5bqgx9oyn6op.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 «
114 116 153 162 161 149 139 135 130 127 122 117 112 113 149 157 157 147 137 132 125 123 117 114 111 112 144 150 149 134 123 116 117 111 105 102 95 93 124 130 124 115 106 105 105 101 95 93 84 87 116 120 117 109 105 107 109 109 108 107
 
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


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha1
beta0
gamma0.432015235872734


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13112113.387857793709-1.38785779370852
14113112.9270737831590.0729262168412532
15149149.043505980836-0.0435059808360734
16157157.095249460890-0.095249460890301
17157157.095519289391-0.0955192893914898
18147147.043274160734-0.043274160733688
19137135.3167095571861.68329044281415
20132132.968509499453-0.968509499452836
21125127.102166225199-2.1021662251992
22123122.1778315762900.822168423710437
23117118.220013167857-1.22001316785700
24114112.1570906425211.84290935747875
25111109.0175434234881.98245657651211
26112111.9165702373760.0834297626242346
27144147.721620291083-3.72162029108301
28150151.811910439922-1.81191043992195
29149150.075689261063-1.07568926106282
30134139.533919002382-5.53391900238236
31123123.323179263295-0.323179263294890
32116119.350423394794-3.35042339479357
33117111.6614300625845.33856993741581
34111114.340650102666-3.34065010266555
35105106.660214202392-1.66021420239208
36102100.6273966670601.37260333293960
379597.5160407698656-2.51604076986555
389395.7485135048482-2.74851350484822
39124122.6057921857751.39420781422534
40130130.678554356048-0.678554356048267
41124130.019032037267-6.01903203726678
42115116.067184132535-1.06718413253455
43106105.7941734491470.205826550853416
44105102.8141759819932.18582401800698
45105101.0459239507863.95407604921364
46101102.584877892230-1.58487789222956
479597.027048397838-2.02704839783799
489391.01931835417631.98068164582367
498488.8899137796488-4.88991377964878
508784.63297450123552.36702549876446
51116114.6744780472561.32552195274377
52120122.225211922499-2.22521192249881
53117119.990703425369-2.99070342536878
54109109.496498368977-0.496498368977143
55105100.2586979288894.74130207111078
56107101.8414555459465.15854445405408
57109102.9760159711136.02398402888674
58109106.5034686290422.49653137095846
59108104.7335810414813.26641895851873
60107103.5098201609263.49017983907439


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
61102.30833354220896.819429944689107.797237139727
62103.13361046301495.3302552717974110.936965654231
63136.001266842365124.316650915753147.685882768978
64143.359906637913129.848042135511156.871771140314
65143.416785436193128.797127305835158.036443566552
66134.293126366769119.51308930069149.073163432849
67123.593611567894108.894567638771138.292655497017
68119.927841497958104.612405020897135.243277975019
69115.45197782874399.6855754390117131.218380218474
70112.82413376749996.4323023235536129.215965211444
71108.41743250559291.7001157424877125.134749268697
72103.91089258133381.0390277227304126.782757439935
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/05/t1259970471n5v5bqgx9oyn6op/13le51259970411.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/05/t1259970471n5v5bqgx9oyn6op/13le51259970411.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/05/t1259970471n5v5bqgx9oyn6op/2kbqg1259970411.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/05/t1259970471n5v5bqgx9oyn6op/2kbqg1259970411.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/05/t1259970471n5v5bqgx9oyn6op/3cg0q1259970411.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/05/t1259970471n5v5bqgx9oyn6op/3cg0q1259970411.ps (open in new window)


 
Parameters (Session):
par1 = FALSE ; par2 = -0.5 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
Parameters (R input):
par1 = 12 ; par2 = Triple ; par3 = multiplicative ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1)
if (par2 == 'Single') K <- 1
if (par2 == 'Double') K <- 2
if (par2 == 'Triple') K <- par1
nx <- length(x)
nxmK <- nx - K
x <- ts(x, frequency = par1)
if (par2 == 'Single') fit <- HoltWinters(x, gamma=0, beta=0)
if (par2 == 'Double') fit <- HoltWinters(x, gamma=0)
if (par2 == 'Triple') fit <- HoltWinters(x, seasonal=par3)
fit
myresid <- x - fit$fitted[,'xhat']
bitmap(file='test1.png')
op <- par(mfrow=c(2,1))
plot(fit,ylab='Observed (black) / Fitted (red)',main='Interpolation Fit of Exponential Smoothing')
plot(myresid,ylab='Residuals',main='Interpolation Prediction Errors')
par(op)
dev.off()
bitmap(file='test2.png')
p <- predict(fit, par1, prediction.interval=TRUE)
np <- length(p[,1])
plot(fit,p,ylab='Observed (black) / Fitted (red)',main='Extrapolation Fit of Exponential Smoothing')
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(myresid),lag.max = nx/2,main='Residual ACF')
spectrum(myresid,main='Residals Periodogram')
cpgram(myresid,main='Residal Cumulative Periodogram')
qqnorm(myresid,main='Residual Normal QQ Plot')
qqline(myresid)
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Estimated Parameters of Exponential Smoothing',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'Value',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'alpha',header=TRUE)
a<-table.element(a,fit$alpha)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'beta',header=TRUE)
a<-table.element(a,fit$beta)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'gamma',header=TRUE)
a<-table.element(a,fit$gamma)
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,'Interpolation Forecasts of Exponential Smoothing',4,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,'Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:nxmK) {
a<-table.row.start(a)
a<-table.element(a,i+K,header=TRUE)
a<-table.element(a,x[i+K])
a<-table.element(a,fit$fitted[i,'xhat'])
a<-table.element(a,myresid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Extrapolation Forecasts of Exponential Smoothing',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Forecast',header=TRUE)
a<-table.element(a,'95% Lower Bound',header=TRUE)
a<-table.element(a,'95% Upper Bound',header=TRUE)
a<-table.row.end(a)
for (i in 1:np) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,p[i,'fit'])
a<-table.element(a,p[i,'lwr'])
a<-table.element(a,p[i,'upr'])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.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