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 09:10:30 -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/t125977027793qc5dff6stv62i.htm/, Retrieved Wed, 02 Dec 2009 17:11:21 +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/t125977027793qc5dff6stv62i.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 «
108.5 112.3 116.6 115.5 120.1 132.9 128.1 129.3 132.5 131 124.9 120.8 122 122.1 127.4 135.2 137.3 135 136 138.4 134.7 138.4 133.9 133.6 141.2 151.8 155.4 156.6 161.6 160.7 156 159.5 168.7 169.9 169.9 185.9 190.8 195.8 211.9 227.1 251.3 256.7 251.9 251.2 270.3 267.2 243 229.9 187.2 178.2 175.2 192.4 187 184 194.1 212.7 217.5 200.5 205.9 196.5 206.3
 
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


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13122116.5163977263135.48360227368678
14122.1122.182945499263-0.0829454992628911
15127.4127.718432479231-0.318432479230864
16135.2135.610161653526-0.410161653525876
17137.3137.418292153351-0.118292153351263
18135134.8859201746690.114079825330947
19136138.310626170459-2.31062617045879
20138.4137.0303006886631.36969931133706
21134.7141.695776982594-6.99577698259381
22138.4132.6615482257445.73845177425594
23133.9131.1470735827212.75292641727867
24133.6129.4430170828364.15698291716396
25141.2135.2443357785065.955664221494
26151.8141.29385102903110.5061489709687
27155.4158.595650753974-3.19565075397423
28156.6165.233514265211-8.63351426521129
29161.6159.0376641526922.56233584730774
30160.7158.6148134071262.08518659287409
31156164.483294211696-8.48329421169589
32159.5157.0599088831382.44009111686202
33168.7163.1696196923915.53038030760914
34169.9165.9385963464483.961403653552
35169.9160.8192707296139.08072927038745
36185.9164.04373508561521.8562649143846
37190.8187.8934371198272.90656288017317
38195.8190.6636903142665.13630968573352
39211.9204.3396778276687.56032217233187
40227.1225.0092079280772.09079207192346
41251.3230.26036162715721.0396383728433
42256.7246.206653857810.4933461422000
43251.9262.248902459119-10.3489024591186
44251.2253.101880175646-1.90188017564591
45270.3256.49432947857113.8056705214294
46267.2265.3782460247871.82175397521314
47243252.473390805565-9.47339080556546
48229.9234.302415252370-4.40241525237033
49187.2232.18713614503-44.9871361450299
50178.2187.080395527435-8.8803955274349
51175.2186.042066998191-10.8420669981906
52192.4186.1814564691896.21854353081119
53187195.204650955328-8.20465095532813
54184183.4178540698590.582145930141422
55194.1188.2118220467475.88817795325252
56212.7195.21631249361317.4836875063870
57217.5217.3121994156710.187800584329267
58200.5213.700947766753-13.2009477667525
59205.9189.64369081516416.2563091848360
60196.5198.644453088395-2.14445308839490
61206.3198.5641918849897.73580811501066


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
62206.091765090902185.623894483243226.559635698562
63215.039377394812185.514198788967244.564556000658
64228.330596626208190.985166291131265.676026961285
65231.503573133845188.580906818577274.426239449112
66226.875489269687180.231011058486273.519967480888
67231.875866706714180.151528484447283.600204928982
68233.048102960723177.350094443693288.746111477753
69238.020823227108177.753870261532298.287776192684
70233.785430766897171.349699910565296.22116162323
71220.997718238484158.725035072443283.270401404525
72213.155338956595149.900135738223276.410542174967
73215.330704860129147.258284662347283.403125057911
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t125977027793qc5dff6stv62i/1joov1259770228.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t125977027793qc5dff6stv62i/1joov1259770228.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/02/t125977027793qc5dff6stv62i/398bj1259770228.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t125977027793qc5dff6stv62i/398bj1259770228.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 = Triple ; par3 = multiplicative ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
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