Home » date » 2011 » May » 18 »

*Unverified author*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Wed, 18 May 2011 14:34:54 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2011/May/18/t13057290555s95ac4p5o03a65.htm/, Retrieved Wed, 18 May 2011 16:30:58 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
31.900 31.815 31.075 31.070 31.300 31.410 30.310 31.440 31.355 31.380 31.975 31.905 32.565 32.780 32.850 32.910 32.910 33.755 34.130 34.330 34.120 33.600 33.715 33.535 33.745 34.295 33.940 34.245 34.395 33.640 33.890 33.905 33.930 33.975 33.880 33.800 33.165 33.660 33.545 33.590 33.810 33.720 33.660 33.915 34.265 34.175 33.735 33.855 34.210 33.950 33.130 32.195 33.160 33.255 32.260 31.795 31.875 31.985 31.835 32.200 32.275 32.515 32.700 32.680 32.135 31.460 30.755 31.090 31.270 31.110 30.835 31.025 30.800 30.790
 
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'Gwilym Jenkins' @ www.wessa.org


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.956867038068198
beta0.00845972160096074
gammaFALSE


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
331.07531.73-0.655000000000005
431.0731.01294997723330.057050022766699
531.330.97769896087230.322301039127687
631.4131.19886687059930.211133129400686
730.3131.3153709583438-1.00537095834381
831.4430.25970407711121.18029592288885
931.35531.30498408409890.0500159159011311
1031.3831.26914127888660.110858721113399
1131.97531.29241433084850.682585669151457
1231.90531.86827946826320.0367205317367691
1332.56531.82643479106450.738565208935519
1432.7832.46214071020880.317859289791251
1532.8532.69786001912150.152139980878481
1632.9132.77623953085560.133760469144356
1732.9132.8381150617270.0718849382730014
1833.75532.84136583290970.913634167090315
1934.1333.65745440759080.472545592409183
2034.3334.05530503993880.274694960061218
2134.1234.2660625323925-0.146062532392541
2233.634.0730286981104-0.473028698110383
2333.71533.56330263098370.151697369016318
2433.53533.6525843095367-0.117584309536703
2533.74533.48324740107710.261752598922882
2634.29533.67900431910870.615995680891338
2733.9434.2187111452878-0.278711145287815
2834.24533.90004638176940.34495361823064
2934.39534.1809382137330.21406178626701
3033.6434.3383167596403-0.698316759640278
3133.8933.61701759414490.272982405855096
3233.90533.82733233004270.0776676699573144
3333.9333.85138553959870.0786144604013046
3433.97533.87698107231680.0980189276831638
3533.8833.9219375466022-0.0419375466022345
3633.833.8326348066217-0.0326348066217079
3733.16533.7519693787213-0.586969378721328
3833.6633.13612805411420.523871945885752
3933.54533.5874548312372-0.0424548312371869
4033.5933.49653851796730.0934614820327297
4133.8133.5364325994930.273567400507019
4233.7233.7508785790267-0.0308785790267478
4333.6633.673760279063-0.0137602790629714
4433.91533.61291052897970.302089471020295
4534.26533.85673235626860.408267643731364
4634.17534.2054574338478-0.0304574338477721
4733.73534.1341343982063-0.399134398206314
4833.85533.70680560307290.14819439692706
4934.2133.80439729925330.405602700746726
5033.9534.1515778010873-0.201577801087261
5133.1333.9161355567788-0.78613555677876
5232.19533.1149856314946-0.91998563149459
5333.1632.17831185553140.981688144468627
5433.25533.06923363036260.185766369637413
5532.2633.200067840927-0.940067840927028
5631.79532.246018716886-0.451018716886004
5731.87531.75627366035920.118726339640805
5831.98531.81265993791280.172340062087159
5931.83531.9217424825531-0.0867424825531025
6032.231.78221531454650.417784685453455
6132.27532.1288354588990.146164541101015
6232.51532.21673441717490.298265582825053
6332.732.45258825754780.247411742452179
6432.6832.64178448999490.0382155100050952
6532.13532.6311170911344-0.496117091134444
6631.4632.105148455985-0.645148455985037
6730.75531.4313542539015-0.676354253901494
6831.0930.72222528053460.367774719465402
6931.2731.01516597864760.254834021352433
7031.1131.2021002832427-0.092100283242651
7130.83531.0563190513748-0.221319051374799
7231.02530.78510109976130.239898900238735
7330.830.9571493439271-0.157149343927085
7430.7930.74800311370030.0419968862996711


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
7530.729753304535829.876268686760831.5832379223107
7630.671318059169629.485265703461431.8573704148778
7730.612882813803429.164976725734532.0607889018723
7830.554447568437128.881824776443132.2270703604312
7930.496012323070928.622374004948732.3696506411932
8030.437577077704728.379644102182432.4955100532271
8130.379141832338528.149463554766132.6088201099109
8230.320706586972327.929107272767332.7123059011774
8330.262271341606127.716681082002932.8078616012093
8430.203836096239927.510806546628132.8968656458517
8530.145400850873727.3104444316432.9803572701074
8630.086965605507527.114788883849733.0591423271652
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/18/t13057290555s95ac4p5o03a65/1np3g1305729291.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t13057290555s95ac4p5o03a65/1np3g1305729291.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/18/t13057290555s95ac4p5o03a65/26dbd1305729291.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t13057290555s95ac4p5o03a65/26dbd1305729291.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/18/t13057290555s95ac4p5o03a65/3tloh1305729291.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/18/t13057290555s95ac4p5o03a65/3tloh1305729291.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