Home » date » 2008 » May » 28 »

Opgave 10: Extra oefening: hotelkamers: Exponential smoothing: Vincent Van Gestel - 2MAR04B

R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Wed, 28 May 2008 03:09:32 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/May/28/t12119660940w2z8esze8n9784.htm/, Retrieved Wed, 28 May 2008 11:14:54 +0200
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
65.05 65.84 66.6 67.55 68.07 69.06 69.06 69.11 69.29 69.38 69.28 69.75 69.9 70.21 70.48 71.55 72.18 72.64 72.77 72.74 73.13 73.44 73.34 73.34 73.81 74.26 74.72 75.11 75.26 75.89 75.91 76.43 76.56 76.76 76.76 76.56 76.82 77.09 77.51 77.76 77.86 77.89 77.94 77.99 78.17 78.91 78.87 78.88 79.08 79.41 79.51 79.73 80.38 80.56 80.46 80.45 80.58 80.68 80.52 81.49 81.66 81.95 82.3 82.4 83.14 83.17 83.11 83.21 83.33 83.88 83.8 83.73
 
Text written by user:
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.91765681329827
beta0.0281982947013472
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
1369.968.02802916666671.87197083333332
1470.2170.10975244512550.100247554874514
1570.4870.5228191607047-0.0428191607047381
1671.5571.58557505941-0.0355750594100357
1772.1872.2048913374113-0.0248913374112476
1872.6472.68295084189-0.0429508418899331
1972.7772.8195765077098-0.0495765077097872
2072.7472.7696725600557-0.0296725600557295
2173.1373.1435157878132-0.0135157878132333
2273.4473.4722523150126-0.0322523150125988
2373.3473.4212939012777-0.081293901277661
2473.3473.436145218406-0.0961452184060647
2573.8173.8711076123279-0.061107612327902
2674.2674.02244121058340.237558789416610
2774.7274.54268732817080.177312671829171
2875.1175.8066967965121-0.696696796512128
2975.2675.8017541088003-0.541754108800276
3075.8975.77219353574280.117806464257242
3175.9176.028123117202-0.118123117201989
3276.4375.88751158104440.542488418955642
3376.5676.7730937917569-0.21309379175689
3476.7676.8973401889136-0.137340188913640
3576.7676.72338645025410.0366135497458657
3676.5676.8257419727494-0.265741972749396
3776.8277.0840978458444-0.264097845844390
3877.0977.04463655692960.0453634430704284
3977.5177.34946647307340.160533526926628
4077.7678.4915895617186-0.731589561718593
4177.8678.4319627090602-0.571962709060188
4277.8978.3927865831474-0.50278658314744
4377.9478.0075341009755-0.067534100975493
4477.9977.91678840693220.0732115930677537
4578.1778.2464209468388-0.0764209468388088
4678.9178.44276295259030.467237047409682
4778.8778.79401084394440.0759891560555985
4878.8878.8647049446210.0152950553789708
4979.0879.3454661605704-0.265466160570440
5079.4179.29457026656860.115429733431441
5179.5179.639332533077-0.129332533077033
5279.7380.4006491909566-0.670649190956595
5380.3880.3703171754590.00968282454105918
5480.5680.8458673936501-0.285867393650108
5580.4680.6764046131194-0.216404613119437
5680.4580.4376763547750.0123236452249529
5780.5880.6745779025397-0.0945779025396547
5880.6880.8740192182473-0.194019218247334
5980.5280.5441279228942-0.0241279228942375
6081.4980.47324422195251.01675577804747
6181.6681.8310911391947-0.171091139194701
6281.9581.88181260915520.0681873908447699
6382.382.1454949542480.154505045752032
6482.483.1124748853218-0.712474885321768
6583.1483.08847116971660.0515288302834165
6683.1783.567857162711-0.397857162710949
6783.1183.2882201563354-0.178220156335357
6883.2183.09122857529460.118771424705429
6983.3383.4076267565173-0.077626756517347
7083.8883.60549044341450.274509556585457
7183.883.72271633050170.0772836694982715
7283.7383.836406681119-0.106406681118941


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
7384.042504793667883.283118734480284.8018908528553
7484.251099364200383.20704575285985.2951529755416
7584.438719509313383.161232241650585.7162067769761
7685.167931667407483.683607993022486.6522553417923
7785.854486865159784.179807984404887.5291657459145
7886.242090802762784.388245144312588.0959364612128
7986.348438439091984.32345149052788.3734253876569
8086.346861416022484.156700038508888.537022793536
8186.542437150253984.191645765458188.8932285350496
8286.84688129524184.338976946170889.3547856443113
8386.695207811916284.032939721788389.3574759020442
8486.720099210530483.905626991781889.534571429279
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/28/t12119660940w2z8esze8n9784/1vvf81211965765.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/28/t12119660940w2z8esze8n9784/1vvf81211965765.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/28/t12119660940w2z8esze8n9784/2lvc41211965765.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/28/t12119660940w2z8esze8n9784/2lvc41211965765.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/28/t12119660940w2z8esze8n9784/3chqz1211965765.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/28/t12119660940w2z8esze8n9784/3chqz1211965765.ps (open in new window)


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