Home » date » 2009 » Dec » 04 »

Workshop 9-10

*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 15:11:18 -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/04/t1259964750iaya3f6sv89rdv9.htm/, Retrieved Fri, 04 Dec 2009 23:12:33 +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/04/t1259964750iaya3f6sv89rdv9.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:
WS 9-10
 
Dataseries X:
» Textbox « » Textfile « » CSV «
5.7 6.1 6 5.9 5.8 5.7 5.6 5.4 5.4 5.5 5.6 5.7 5.9 6.1 6 5.8 5.8 5.7 5.5 5.3 5.2 5.2 5 5.1 5.1 5.2 4.9 4.8 4.5 4.5 4.4 4.4 4.2 4.1 3.9 3.8 3.9 4.2 4.1 3.8 3.6 3.7 3.5 3.4 3.1 3.1 3.1 3.2 3.3 3.5 3.6 3.5 3.3 3.2 3.1 3.2 3 3 3.1 3.4
 
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.795617759934405
beta0.115622092346912
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
135.95.91141206844105-0.0114120684410484
146.16.099595015067990.000404984932013797
1566.00157408438233-0.00157408438233375
165.85.81031371087173-0.0103137108717304
175.85.82842033663677-0.028420336636767
185.75.74202426512985-0.0420242651298519
195.55.459474083747930.0405259162520668
205.35.274157194186420.0258428058135802
215.25.28338773530909-0.0833877353090866
225.25.29816326227001-0.0981632622700124
2355.28991767617873-0.289917676178727
245.15.093000163203270.00699983679672567
255.15.22129803504218-0.121298035042178
265.25.23686392003097-0.0368639200309691
274.95.05919557120876-0.159195571208759
284.84.698307567264490.101692432735510
294.54.73103257316789-0.231032573167893
304.54.409268482636270.0907315173637349
314.44.227307523540780.172692476459217
324.44.133393421792690.266606578207315
334.24.28455429904767-0.0845542990476673
344.14.24486578898424-0.14486578898424
353.94.10933651747807-0.209336517478072
363.83.97489505508343-0.174895055083426
373.93.845150594731860.0548494052681359
384.23.936739893636450.263260106363548
394.13.986501698334470.113498301665525
403.83.93018633909184-0.130186339091839
413.63.71434602817831-0.114346028178310
423.73.553851749132840.146148250867164
433.53.472197208122450.0278027918775474
443.43.308844764416030.0911552355839738
453.13.25237280793271-0.152372807932715
463.13.10534363273615-0.00534363273615002
473.13.047746951063480.0522530489365201
483.23.114685173818090.0853148261819148
493.33.251027181562220.0489728184377793
503.53.387438630265190.112561369734810
513.63.330445262006620.269554737993377
523.53.40357208013440.0964279198655986
533.33.43178898730854-0.131788987308539
543.23.36210769613620-0.162107696136195
553.13.057990016040150.0420099839598529
563.22.959329107182250.240670892817750
5733.02065973935298-0.0206597393529750
5833.06029592031758-0.060295920317579
593.13.019382363427380.0806176365726174
603.43.16881835514140.231181644858601


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
613.490021791071763.224068046675393.75597553546813
623.679249547571163.315124591201524.04337450394081
633.615990898358263.171948851427854.06003294528867
643.469385962626862.957394181299833.9813777439539
653.395858617867052.810263554768333.98145368096577
663.459694615014722.779207015532564.14018221449687
673.366907735523372.618386447787144.11542902325959
683.311067118222.488109969308224.13402426713179
693.141383991215922.272973959933474.00979402249837
703.214402288558562.237576354215574.19122822290154
713.282458426284672.193536015916774.37138083665256
723.42532446035466-123.777322913226130.627971833935
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964750iaya3f6sv89rdv9/17kx41259964676.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964750iaya3f6sv89rdv9/17kx41259964676.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964750iaya3f6sv89rdv9/2aqmm1259964676.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964750iaya3f6sv89rdv9/2aqmm1259964676.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964750iaya3f6sv89rdv9/3mips1259964676.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964750iaya3f6sv89rdv9/3mips1259964676.ps (open in new window)


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