Home » date » 2009 » Dec » 04 »

WS9 Exponential smoothing

*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 07:20:29 -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/t12599364788plxyn3eusumub8.htm/, Retrieved Fri, 04 Dec 2009 15:21:22 +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/t12599364788plxyn3eusumub8.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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
7.1 6.9 6.8 7.5 7.6 7.8 8.0 8.1 8.2 8.3 8.2 8.0 7.9 7.6 7.6 8.3 8.4 8.4 8.4 8.4 8.6 8.9 8.8 8.3 7.5 7.2 7.4 8.8 9.3 9.3 8.7 8.2 8.3 8.5 8.6 8.5 8.2 8.1 7.9 8.6 8.7 8.7 8.5 8.4 8.5 8.7 8.7 8.6 8.5 8.3 8.0 8.2 8.1 8.1 8.0 7.9 7.9 8.0 8.0 7.9 8.0 7.7 7.2 7.5 7.3 7.0 7.0 7.0 7.2 7.3 7.1 6.8 6.4 6.1 6.5 7.7 7.9 7.5 6.9 6.6 6.9 7.7 8.0 8.0 7.7 7.3 7.4 8.1 8.3 8.2
 
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
alpha1
beta1
gamma1


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
137.97.544856902550720.355143097449276
147.67.9583753600631-0.358375360063103
157.67.6-8.88178419700125e-16
168.38.287347560975610.0126524390243912
178.48.391515151515160.00848484848484432
188.48.41266968325791-0.0126696832579114
198.48.60279870828849-0.202798708288487
208.48.272119594233850.127880405766152
218.68.399096437539240.200903562460763
228.98.796189830945930.103810169054075
238.88.98232931726907-0.182329317269073
248.38.60118740657386-0.301187406573861
257.57.93479492873633-0.434794928736326
267.26.56231072672890.637689273271094
277.47.184918736504570.215081263495430
288.88.285793752674370.51420624732563
299.39.61602621010358-0.316026210103576
309.39.70384342801068-0.403843428010676
318.79.5245271413194-0.824527141319397
328.27.953148501258480.246851498741519
338.37.694761489066750.60523851093325
348.58.395577829144310.104422170855692
358.68.493554216867460.106445783132536
368.58.59333011416109-0.0933301141610894
378.28.51806716099568-0.318067160995684
388.17.71596941523010.384030584769903
397.98.30988091697806-0.409880916978059
408.68.39794541613180.202054583868204
418.78.667169155089260.0328308449107393
428.78.70954587581093-0.00954587581093058
438.58.91004151929879-0.410041519298787
448.48.16579589657540.234204103424608
458.58.298225145166360.201774854833642
468.78.595451974827870.104548025172129
478.78.68877510040160.0112248995983961
488.68.597258760367480.00274123963252393
498.58.61939915186189-0.119399151861886
508.38.196941393248510.103058606751489
5188.42190687992139-0.421906879921387
528.28.39872232028242-0.198722320282416
538.17.753139255586940.346860744413058
548.17.915520907158040.184479092841961
5588.29555589727818-0.295555897278181
567.97.775808481427810.124191518572191
577.97.798278928646160.101721071353839
5887.89502875450090.104971245499104
5987.90716867469880.0928313253012085
607.97.90552529688963-0.00552529688963332
6187.910075215798450.0899247842015463
627.77.89757326654945-0.197573266549445
637.27.70377031587386-0.503770315873858
647.57.309835660034240.190164339965764
657.37.219244826194730.080755173805267
6677.02371476857656-0.0237147685765633
6776.864524065815780.135475934184220
6876.893432995194870.106567004805127
697.26.99924703128270.200752968717303
707.37.39707081116096-0.0970708111609593
717.17.22389558232931-0.123895582329315
726.86.82637286098008-0.0263728609800795
736.46.60511919100673-0.205119191006725
746.15.86603196024110.233968039758905
756.56.043445261892140.45655473810786
767.77.520931616388530.179068383611465
777.98.38669837243712-0.486698372437122
787.58.01801232077631-0.518012320776311
796.97.27510379824697-0.375103798246966
806.66.180551445351230.419448554648769
816.96.29667618094790.603323819052103
827.77.198060375911880.501939624088116
8388.30267068273092-0.302670682730922
8488.19019655690384-0.190196556903835
857.78.1065592692964-0.406559269296396
867.37.228256849781670.0717431502183272
877.47.193174383574040.206825616425958
888.18.17752660997005-0.0775266099700502
898.38.207745815799080.0922541842009164
908.28.41384724418034-0.213847244180336


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
918.29647854836237.71946060086188.87349649586279
928.268968804820386.974182709420299.56375490022047
938.24032990314776.066571387303910.4140884189915
948.206276260504215.0156925900294611.3968599309790
957.976696428571433.7465952041657212.2067976529771
967.664647658442912.392964839362312.9363304775235
977.46981922398591.0382742847655813.9013641632062
987.10277513363111-0.35466256536112714.5602128326234
997.01999124471036-1.7874449791850015.8274274686057
1007.56525479094078-3.5906500405984318.72115962248
1017.54727272727274-5.3532338377277620.4477792922733
1027.45067873303169-9.8924290141020524.7937864801654
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599364788plxyn3eusumub8/1hh2m1259936427.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t12599364788plxyn3eusumub8/1hh2m1259936427.ps (open in new window)


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


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


 
Parameters (Session):
par1 = 0.01 ; par2 = 0.99 ; par3 = 0.005 ;
 
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