Home » date » 2010 » Dec » 07 »

Workshop 5

*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: Tue, 07 Dec 2010 13:27:14 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/07/t1291728779yl68l164sx6axsg.htm/, Retrieved Tue, 07 Dec 2010 14:33:04 +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/2010/Dec/07/t1291728779yl68l164sx6axsg.htm/},
    year = {2010},
}
@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 = {2010},
    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:
Exponential Smoothing
 
Dataseries X:
» Textbox « » Textfile « » CSV «
-5 -1 -2 -5 -4 -6 -2 -2 -2 -2 2 1 -8 -1 1 -1 2 2 1 -1 -2 -2 -1 -8 -4 -6 -3 -3 -7 -9 -11 -13 -11 -9 -17 -22 -25 -20 -24 -24 -22 -19 -18 -17 -11 -11 -12 -10 -15 -15 -15 -13 -8 -13 -9 -7 -4 -4 -2 0
 
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.81736044436888
beta0.186444348831529
gammaFALSE


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
3-23-5
4-52.15123659910057-7.15123659910057
5-4-1.54565543853273-2.45434456146727
6-6-1.77751676830599-4.22248323169401
7-2-4.098058367633912.09805836763391
8-2-0.93271147117745-1.06728852882255
9-2-0.517240405753006-1.48275959424699
10-2-0.667320004723815-1.33267999527618
112-0.8978205600898792.89782056008988
1212.77112805251206-1.77112805251206
13-82.3539565885523-10.3539565885523
14-1-6.656342015586795.65634201558679
151-1.718473231901292.71847323190129
16-11.23237203105538-2.23237203105538
172-0.2036039550942692.20360395509427
1822.32202349556383-0.322023495563832
1912.73422909036914-1.73422909036914
20-11.72787064417432-2.72787064417432
21-2-0.506357410451018-1.49364258954898
22-2-1.95939580761916-0.0406041923808396
23-1-2.230965858453121.23096585845312
24-8-1.27561520811459-6.72438479188541
25-4-7.847397533335963.84739753333596
26-6-5.1919096472845-0.808090352715497
27-3-6.464780104117623.46478010411762
28-3-3.717169678962990.71716967896299
29-7-3.10605624103229-3.89394375896771
30-9-6.85729132731534-2.14270867268466
31-11-9.50366829060175-1.49633170939825
32-13-11.8497516266567-1.15024837334333
33-11-14.08824905471683.08824905471684
34-9-12.39174116333193.39174116333187
35-17-9.9302958080145-7.0697041919855
36-22-17.0969901053992-4.90300989460079
37-25-23.2398948291037-1.76010517089627
38-20-27.08213991348757.08213991348746
39-24-22.6178204907380-1.38217950926195
40-24-25.28253437835581.28253437835582
41-22-25.57376825725233.57376825725229
42-19-23.44762365974784.44762365974783
43-18-19.92944090859061.92944090859057
44-17-18.17548931599591.17548931599592
45-11-16.85865248712055.85865248712049
46-11-10.8211701762907-0.178829823709291
47-12-9.74573936657476-2.25426063342524
48-10-10.71021542377350.710215423773509
49-15-9.14341469720308-5.85658530279692
50-15-13.8365552590952-1.16344474090476
51-15-14.8710083111426-0.128991688857363
52-13-15.07959768875582.07959768875584
53-8-13.16605892987785.16605892987782
54-13-7.94250156877353-5.05749843122647
55-9-11.84599908891742.84599908891743
56-7-8.855782199651961.85578219965196
57-4-6.392122628434852.39212262843485
58-4-3.12553869033348-0.87446130966652
59-2-2.662192365557190.662192365557194
600-0.841933134834740.84193313483474


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
611.25354316375645-5.732634520719788.23972084823267
622.66085662113023-7.070816826407812.3925300686683
634.06817007850401-8.4283609386460816.5647010956541
645.47548353587779-9.8688004216321120.8197674933877
656.88279699325157-11.415390611487125.1809845979902
668.29011045062535-13.077155617393929.6573765186446
679.69742390799913-14.857069212182334.2519170281806
6811.1047373653729-16.755266269428238.964741000174
6912.5120508227467-18.770483969980643.794585615474
7013.9193642801205-20.900767646404748.7394962066457
7115.3266777374943-23.143837321558453.7971927965469
7216.7339911948680-25.497285378935858.9652677686719
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291728779yl68l164sx6axsg/10ya81291728431.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291728779yl68l164sx6axsg/10ya81291728431.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291728779yl68l164sx6axsg/26m2m1291728431.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291728779yl68l164sx6axsg/26m2m1291728431.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291728779yl68l164sx6axsg/36m2m1291728431.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291728779yl68l164sx6axsg/36m2m1291728431.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Double ; par3 = additive ;
 
Parameters (R input):
par1 = 12 ; par2 = Double ; 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=F, beta=F)
if (par2 == 'Double') fit <- HoltWinters(x, gamma=F)
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