Home » date » 2008 » Aug » 12 »

sven van roy - tweede zittijd - oefening 10 - exponential smoothing

R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Tue, 12 Aug 2008 11:56:58 -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/Aug/12/t1218564013okbgbp8ivq6y3r8.htm/, Retrieved Tue, 12 Aug 2008 18:00:13 +0000
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
0.22 0.22 0.2 0.21 0.21 0.19 0.19 0.18 0.18 0.19 0.18 0.17 0.17 0.17 0.18 0.2 0.2 0.2 0.22 0.23 0.25 0.25 0.27 0.29 0.3 0.31 0.33 0.31 0.33 0.33 0.35 0.37 0.47 0.45 0.45 0.4 0.34 0.35 0.34 0.35 0.36 0.37 0.36 0.35 0.36 0.33 0.3 0.28 0.28 0.28 0.3 0.32 0.32 0.3 0.3 0.31 0.33 0.34 0.31 0.33 0.35 0.38 0.4 0.32 0.29 0.3 0.3 0.32 0.32 0.32 0.32 0.32 0.33 0.31 0.33 0.35 0.37 0.37 0.38 0.42 0.42 0.49 0.45 0.41 0.4 0.42 0.47 0.49 0.47 0.52 0.56 0.57 0.61 0.52 0.5 0.5
 
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.83737132434265
beta0
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
130.170.1348918306620010.0351081693379985
140.170.1613890291115550.00861097088844537
150.180.1739103369366710.00608966306332939
160.20.1934902033118950.00650979668810495
170.20.1928883390353340.00711166096466626
180.20.1907194862214530.00928051377854672
190.220.2082127168981110.0117872831018890
200.230.217119785405480.0128802145945200
210.250.2356492586613150.0143507413386849
220.250.2372968824076100.0127031175923895
230.270.2578053458855420.0121946541144582
240.290.2767154736218160.0132845263781843
250.30.2632695485641770.0367304514358226
260.310.281451800201670.0285481997983298
270.330.3141092844321970.0158907155678029
280.310.353827019841738-0.0438270198417379
290.330.3076299754370680.0223700245629319
300.330.3135843872477040.0164156127522964
310.350.3437670918265480.00623290817345185
320.370.347583024287940.0224169757120602
330.470.3788898265614820.0911101734385179
340.450.4356539616260640.0143460383739363
350.450.465059653523729-0.0150596535237292
360.40.467182926739026-0.0671829267390257
370.340.380628044534449-0.0406280445344492
380.350.3301215907457790.0198784092542206
390.340.354137170417545-0.0141371704175446
400.350.358765416588651-0.0087654165886506
410.360.352626220476090.0073737795239101
420.370.3437332729951580.0262667270048416
430.360.382092491501809-0.0220924915018093
440.350.364675206780122-0.0146752067801224
450.360.372599752807644-0.0125997528076440
460.330.337340719319497-0.00734071931949676
470.30.340424742763661-0.0404247427636607
480.280.309817961589425-0.0298179615894248
490.280.2658870048129660.0141129951870344
500.280.2721500793045940.00784992069540646
510.30.2801238025363170.0198761974636835
520.320.3118766385349030.00812336146509651
530.320.322143195592592-0.00214319559259202
540.30.309446099328076-0.00944609932807572
550.30.308314099477698-0.00831409947769773
560.310.3031982026667920.00680179733320813
570.330.3269782059737480.00302179402625158
580.340.3076555163551380.0323444836448624
590.310.337909363988388-0.0279093639883883
600.330.3193027011062740.0106972988937265
610.350.3142910899354690.0357089100645311
620.380.3360754067884970.0439245932115032
630.40.3770844701729980.0229155298270017
640.320.413669055208418-0.0936690552084178
650.290.337111311878162-0.0471113118781621
660.30.2863780365618860.0136219634381139
670.30.304664249982951-0.00466424998295129
680.320.3050533462607210.0149466537392786
690.320.33546157062212-0.0154615706221201
700.320.3054017294766620.0145982705233380
710.320.311117616849220.00888238315077972
720.320.329853826495010-0.00985382649500954
730.330.3114611948290650.0185388051709350
740.310.319991437024553-0.00999143702455285
750.330.3121421363393670.0178578636606329
760.350.3229020997266870.0270979002733129
770.370.3547019111222370.0152980888777633
780.370.3656219400360560.00437805996394414
790.380.3740836480654450.00591635193455547
800.420.3883726500739590.0316273499260407
810.420.431510554189102-0.0115105541891018
820.490.4056357524006480.084364247599352
830.450.465159441092324-0.0151594410923237
840.410.464074201691166-0.0540742016911657
850.40.411377434924934-0.0113774349249343
860.420.3876307848302030.0323692151697968
870.470.4213094904287340.0486905095712662
880.490.4579082960431780.0320917039568217
890.470.494619389743961-0.0246193897439614
900.520.4692982033025010.0507017966974992
910.560.5187160101496510.0412839898503494
920.570.572487699832381-0.00248769983238140
930.610.583436739306150.0265632606938496
940.520.60181635141335-0.0818163514133499
950.50.503511218308032-0.00351121830803225
960.50.505386933158921-0.00538693315892069


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
970.5002448078502970.4414042103074170.559085405393177
980.4909288840867530.4135370743468590.568320693826647
990.500898565432360.4099738329729710.591823297891749
1000.4932657482390460.3897861928033690.596745303674722
1010.4937101255593840.3778648686358460.609555382482922
1020.5009158770982680.3740788541510790.627752900045456
1030.5057424653063850.3672800782699620.644204852342808
1040.5166535438102590.3658665183254240.667440569295094
1050.5326045776766360.3791604608754590.686048694477813
1060.5123493312687630.3557616674612970.668936995076228
1070.4955372180625690.3300914955306550.660982940594482
1080.5NANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/12/t1218564013okbgbp8ivq6y3r8/1nxw91218563812.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/12/t1218564013okbgbp8ivq6y3r8/1nxw91218563812.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/12/t1218564013okbgbp8ivq6y3r8/2rxxk1218563812.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/12/t1218564013okbgbp8ivq6y3r8/2rxxk1218563812.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/12/t1218564013okbgbp8ivq6y3r8/3mzd11218563812.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/12/t1218564013okbgbp8ivq6y3r8/3mzd11218563812.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