Home » date » 2009 » Dec » 02 »

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: Wed, 02 Dec 2009 14:26:47 -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/02/t1259789261b0qm9choeh99l61.htm/, Retrieved Wed, 02 Dec 2009 22:27:46 +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/02/t1259789261b0qm9choeh99l61.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 «
0.0314796223103059 -3.00870920563557 -2.07677512619799 -1.25010391965540 0.817975239137125 0.0252076485413113 0.554937772830776 0.230027371950115 2.35672227418686 1.41350455171120 2.73311719024401 1.31551925971717 -2.70076272244080 -0.721411049152714 -0.149388576811997 -0.118199629770334 -0.676562489695275 1.79699928690761 1.79845572032988 0.245100010770855 1.80710848932636 -1.75934771184948 -0.0186697168761931 0.189651523600062 -1.84149562719087 -1.07019530156943 -0.507291477584104 0.866365633831705 -1.76077926699189 -0.580719393339347 -0.435702079860853 -0.994868534845203 1.63136048315789 -1.1949403709466 -1.00525975426991 1.32302234837564 -0.628357549594746 0.632048410440518 -2.16903155809288 2.53779364144266 -0.632933703679292 -1.41749196342200 -0.455343045381255 0.812255211942954 0.627897309219833 0.650904313655623 -1.29800419154382 0.74391671726854 -1.50461634127457 -1.42734677658523 0.263353807408564 -0.430830854870631 0.379576092518008 1.70309353400 etc...
 
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


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.00511311737670761
beta0.260114412291294
gamma0.525051146760498


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13-2.7007627224408-3.078434892766690.377672170325891
14-0.721411049152714-1.144146076167180.422735027014468
15-0.149388576811997-0.5416799909651370.39229141415314
16-0.118199629770334-0.3468511427382690.228651512967935
17-0.676562489695275-0.650349492584578-0.0262129971106967
181.796999286907611.99144775679617-0.194448469888564
191.798455720329880.6281944066849961.17026131364488
200.2451000107708550.335905416592872-0.090805405822017
211.807108489326362.29450177275622-0.487393283429857
22-1.759347711849481.22865088406288-2.98799859591236
23-0.01866971687619312.551450621411-2.57012033828719
240.1896515236000621.10909622888707-0.919444705287008
25-1.84149562719087-2.841527338287571.00003171109670
26-1.07019530156943-0.885920041691832-0.184275259877598
27-0.507291477584104-0.308670759806620-0.198620717777484
280.866365633831705-0.2093395923904411.07570522622215
29-1.76077926699189-0.64750923678777-1.11327003020412
30-0.5807193933393471.89353370868427-2.47425310202362
31-0.4357020798608531.22115451235218-1.65685659221303
32-0.9948685348452030.241563466848861-1.23643200169406
331.631360483157891.97150653754671-0.340146054388816
34-1.1949403709466-0.415259403324323-0.779680967622277
35-1.005259754269911.12461887306691-2.12987862733682
361.323022348375640.5348602078742240.788162140501416
37-0.628357549594746-2.414003811776431.78564626218169
380.632048410440518-1.081618819169411.71366722960993
39-2.16903155809288-0.508231423848648-1.66080013424423
402.537793641442660.2412712353023122.29652240614035
41-0.632933703679292-1.340497281187010.707563577507715
42-1.4174919634220.494951825516196-1.91244378893820
43-0.4553430453812550.249200970004793-0.704544015386047
440.812255211942954-0.5078633057223321.32011851766529
450.6278973092198331.70478342316529-1.07688611394546
460.650904313655623-0.9148857674821611.56579008113778
47-1.29800419154382-0.0647312780017505-1.23327291354207
480.743916717268540.87915529562683-0.135238578358290
49-1.50461634127457-1.549831961191360.0452156199167872
50-1.42734677658523-0.262714263898025-1.16463251268720
510.263353807408564-1.469349614265201.73270342167377
52-0.4308308548706311.36659353103896-1.79742438590959
530.379576092518008-1.069655221762571.44923131428058
541.70309353400146-0.6015600865319922.30465362053345
55-3.12314448117342-0.191715463240113-2.93142901793331
56-1.325262071186890.0975546571912894-1.42281672837818
57-0.600324907438041.04051827031719-1.64084317775523
581.23607137604666-0.205882297659981.44195367370664
590.738007075905376-0.8229557457513131.56096282165669
600.8991008962895850.708052743673830.191048152615755


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
61-1.62531067371396-4.411795335679491.16117398825156
62-0.970776169290266-3.757318669305001.81576633072447
63-0.656804300749603-3.443430979139322.12982237764011
640.325135427083718-2.461606696148283.11187755031571
65-0.404711546120209-3.191605305036552.38218221279613
660.502157150503387-2.284929356951823.28924365795859
67-1.83866182775345-4.625987115570290.948663460063385
68-0.746181142481291-3.533796157638812.04143387267623
690.0922334312146882-2.695727168753652.88019403118303
700.468820442929303-2.319546504207943.25718739006654
71-0.0911293248799895-2.879968279806962.69770963004698
720.71655434253189-2.072827171338103.50593585640188
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259789261b0qm9choeh99l61/1ij1j1259789205.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259789261b0qm9choeh99l61/1ij1j1259789205.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259789261b0qm9choeh99l61/2hzqm1259789205.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259789261b0qm9choeh99l61/2hzqm1259789205.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259789261b0qm9choeh99l61/3c39o1259789205.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259789261b0qm9choeh99l61/3c39o1259789205.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Triple ; par3 = additive ;
 
Parameters (R input):
par1 = 12 ; par2 = Triple ; par3 = additive ;
 
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