Home » date » 2009 » Dec » 17 »

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, 16 Dec 2009 15:59:52 -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/17/t1261004425e81kpi5bnpirwul.htm/, Retrieved Thu, 17 Dec 2009 00:00:30 +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/17/t1261004425e81kpi5bnpirwul.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 «
441 449 452 462 455 461 461 463 462 456 455 456 472 472 471 465 459 465 468 467 463 460 462 461 476 476 471 453 443 442 444 438 427 424 416 406 431 434 418 412 404 409 412 406 398 397 385 390 413 413 401 397 397 409 419 424 428 430 424 433 456
 
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
alpha0.496552453079008
beta0.754829928324468
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13472467.5520738174764.44792618252364
14472471.548508947440.451491052560584
15471472.976831065811-1.97683106581104
16465467.425440215685-2.42544021568494
17459460.484037397678-1.48403739767849
18465465.434792758289-0.434792758288552
19468469.131791819429-1.13179181942866
20467467.890571160227-0.8905711602265
21463463.931827028758-0.931827028757766
22460455.472249165674.52775083433016
23462457.0533339718614.94666602813948
24461462.670208747762-1.67020874776165
25476481.778156539560-5.77815653955957
26476476.159533096608-0.159533096607561
27471473.334825803449-2.33482580344872
28453464.559690518383-11.5596905183833
29443447.488480081972-4.4884800819724
30442443.925487876679-1.92548787667863
31444438.3741545086665.62584549133408
32438435.1636208320662.83637916793441
33427429.183211059192-2.18321105919199
34424418.6927686079325.30723139206805
35416416.78219736737-0.782197367370088
36406410.193636427058-4.19363642705838
37431416.64819904216514.3518009578351
38434423.86443106811410.1355689318856
39418429.279831313427-11.2798313134268
40412412.978207551179-0.978207551178912
41404409.319373675879-5.31937367587898
42409410.188424164302-1.18842416430232
43412412.74575799633-0.745757996330099
44406407.150269621264-1.15026962126410
45398397.6047807132750.395219286724853
46397393.6926048906843.30739510931636
47385388.767006210686-3.76700621068613
48390378.91051570827411.0894842917255
49413406.6074081543956.39259184560484
50413410.3791962489422.62080375105825
51401401.670332331658-0.670332331658472
52397399.63788759354-2.63788759353974
53397396.0637726272950.936227372704877
54409407.3691818511781.63081814882185
55419418.1109319490520.88906805094797
56424420.2566683103233.74333168967712
57428422.6645163618555.33548363814509
58430433.555060520055-3.55506052005478
59424429.068051710437-5.06805171043675
60433433.995324171498-0.995324171498396
61456458.713676668363-2.71367666836289


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
62455.436667540855445.905989794802464.967345286908
63441.067604793601428.621646659256453.513562927946
64436.903693812768420.015228667572453.792158957965
65436.274732156254413.753549163715458.795915148792
66448.059427170016418.310984053078477.807870286953
67457.338038587239419.472750193873495.203326980606
68459.214373606561413.034558421519505.394188791604
69457.642469162477402.965005973521512.319932351434
70456.593014579788392.945431670767520.24059748881
71449.342923605335377.320355620725521.365491589946
72457.859049842284374.543513588018541.174586096549
73482.401481211949384.152608633567580.650353790332
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/17/t1261004425e81kpi5bnpirwul/1gavb1261004390.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/17/t1261004425e81kpi5bnpirwul/1gavb1261004390.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/17/t1261004425e81kpi5bnpirwul/2zvua1261004390.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/17/t1261004425e81kpi5bnpirwul/2zvua1261004390.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/17/t1261004425e81kpi5bnpirwul/3amsb1261004390.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/17/t1261004425e81kpi5bnpirwul/3amsb1261004390.ps (open in new window)


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