Home » date » 2009 » Dec » 02 »

WS09 - 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: Wed, 02 Dec 2009 13:49:23 -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/02/t1259787084q1n5qsey8g852su.htm/, Retrieved Wed, 02 Dec 2009 21:51:29 +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/02/t1259787084q1n5qsey8g852su.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 «
423.4 404.1 500 472.6 496.1 562 434.8 538.2 577.6 518.1 625.2 561.2 523.3 536.1 607.3 637.3 606.9 652.9 617.2 670.4 729.9 677.2 710 844.3 748.2 653.9 742.6 854.2 808.4 1819 1936.5 1966.1 2083.1 1620.1 1527.6 1795 1685.1 1851.8 2164.4 1981.8 1726.5 2144.6 1758.2 1672.9 1837.3 1596.1 1446 1898.4 1964.1 1755.9 2255.3 1881.2 2117.9 1656.5 1544.1 2098.9 2133.3 1963.5 1801.2 2365.4 1936.5 1667.6 1983.5 2058.6 2448.3 1858.1 1625.4 2130.6 2515.7 2230.2 2086.9 2235 2100.2 2288.6 2490 2573.7 2543.8 2004.7 2390 2338.4 2724.5 2292.5 2386 2477.9 2337 2605.1 2560.8 2839.3 2407.2 2085.2 2735.6 2798.7 3053.2 2405 2471.9 2727.3 2790.7 2385.4 3206.6 2705.6 3518.4 1954.9 2584.3 2535.8 2685.9 2866 2236.6 2934.9 2668.6 2371.2 3165.9 2887.2 3112.2 2671.2 2432.6 2812.3 3095.7 2862.9 2607.3 2862.5
 
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.346213598844670
beta0
gamma0.383242980338082


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13523.3468.44548727656754.8545127234325
14536.1498.6635263766237.4364736233803
15607.3579.70763085453927.5923691454614
16637.3617.18115103587620.1188489641239
17606.9595.82572587945311.074274120547
18652.9641.3310579087411.5689420912598
19617.2544.6048834351472.5951165648603
20670.4703.977363450823-33.5773634508229
21729.9741.541064358148-11.6410643581482
22677.2658.6592735180318.5407264819694
23710798.861606007522-88.8616060075216
24844.3690.582334067552153.717665932448
25748.2709.71818993511438.4818100648864
26653.9727.902110578053-74.0021105780528
27742.6786.505003080898-43.9050030808976
28854.2801.41248465775252.7875153422481
29808.4776.43091303532131.9690869646787
301819838.502991683396980.497008316604
311936.51013.07365058068923.426349419323
321966.11561.72553117971404.37446882029
332083.11819.37286406244263.727135937559
341620.11707.58414162003-87.4841416200336
351527.61923.92162632109-396.321626321093
3617951723.3175278901271.6824721098778
371685.11593.6786885883891.4213114116171
381851.81559.50749420858292.292505791415
392164.41866.573332006297.826667993998
401981.82090.32148568062-108.521485680624
411726.51916.46122352916-189.961223529157
422144.62338.72818934595-194.128189345952
431758.21890.06218712522-131.862187125217
441672.91948.98889262301-276.08889262301
451837.31934.50892901993-97.2089290199256
461596.11620.97248104066-24.8724810406634
4714461770.08600238853-324.086002388528
481898.41710.77199199425187.628008005747
491964.11624.89663314946339.203366850536
501755.91720.6234382004235.2765617995792
512255.31936.06528564962319.234714350378
521881.22064.92035206239-183.720352062393
532117.91844.95589521561272.944104784394
541656.52460.67229645203-804.17229645203
551544.11822.49542625217-278.395426252171
562098.91788.4901141119310.409885888100
572133.32028.5216907021104.778309297903
581963.51775.65577873815187.844221261852
591801.21927.59225463942-126.392254639415
602365.42095.74516966627269.654830333734
611936.52044.36729662966-107.867296629662
621667.61898.40249141378-230.802491413779
631983.52099.91542005586-116.415420055862
642058.61954.26619078847104.333809211530
652448.31944.10187951795504.198120482055
661858.12356.05138517422-497.951385174217
671625.41926.84740134125-301.447401341247
682130.62047.3555531641383.2444468358653
692515.72160.27464522433355.425354775673
702230.21987.49318770981242.706812290192
712086.92078.602735388478.29726461152904
7222352426.31980271082-191.319802710819
732100.22108.74017584760-8.54017584759731
742288.61954.13452021044334.465479789559
7524902431.6522724360358.3477275639693
762573.72388.39421469764185.305785302360
772543.82502.8381592017240.9618407982825
782004.72489.16653498205-484.466534982046
7923902081.16901205823308.830987941765
802338.42586.96443620870-248.564436208704
812724.52674.2559369587750.2440630412284
822292.52319.63032211609-27.1303221160888
8323862253.35109159517132.648908404832
842477.92621.84724829203-143.947248292027
8523372342.08424960309-5.08424960309412
862605.12260.78152706651344.318472933492
872560.82701.82903771605-141.029037716049
882839.32616.73847733390222.561522666096
892407.22708.00758084818-300.807580848181
902085.22430.14911313109-344.949113131093
912735.62262.61109751585472.988902484153
922798.72700.8303148870697.8696851129407
933053.23011.3585007895141.8414992104899
9424052586.50809709010-181.508097090097
952471.92503.40548652555-31.5054865255488
962727.32761.54246769244-34.2424676924356
972790.72537.14929618599253.55070381401
982385.42627.68142370859-242.281423708586
993206.62749.27354456528457.32645543472
1002705.62965.37509735931-259.775097359306
1013518.42749.47352120628768.926478793724
1021954.92787.89219909764-832.992199097638
1032584.32665.32078027908-81.0207802790833
1042535.82823.53661753304-287.736617533041
1052685.92983.28465081925-297.384650819251
10628662409.97324870202456.026751297976
1072236.62585.36521520188-348.765215201880
1082934.92730.88054591979204.01945408021
1092668.62655.5637611175713.0362388824269
1102371.22538.00990550250-166.809905502497
1113165.92854.37120129727311.528798702729
1122887.22840.9825950026246.2174049973773
1133112.22973.4596939424138.740306057599
1142671.22406.86670493956264.333295060444
1152432.62883.44867870295-450.848678702945
1162812.32864.25108391293-51.9510839129271
1173095.73118.23997266485-22.5399726648461
1182862.92789.2355088962273.6644911037783
1192607.32616.46986007017-9.16986007017249
1202862.53055.59449714028-193.094497140276


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
1212785.130590868082448.173988604403122.08719313175
1222608.844713896622225.712311945842991.9771158474
1233133.376535004862668.858303156333597.89476685338
1242939.469849807112453.540990353113425.39870926110
1253081.700958319862544.273792810563619.12812382917
1262491.156405097811989.244872868232993.06793732739
1272685.164323597762122.105619808543248.22302738699
1282928.008794446822296.648279106023559.36930978763
1293216.246279071432508.811578149713923.68097999316
1302907.891271318932230.933729200663584.84881343719
1312682.806041299792021.832937457903343.77914514167
1323088.466874938222398.256356453663778.67739342277
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259787084q1n5qsey8g852su/1gpsp1259786961.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259787084q1n5qsey8g852su/1gpsp1259786961.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259787084q1n5qsey8g852su/22e9v1259786961.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259787084q1n5qsey8g852su/22e9v1259786961.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259787084q1n5qsey8g852su/33ki01259786961.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259787084q1n5qsey8g852su/33ki01259786961.ps (open in new window)


 
Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
Parameters (R input):
par1 = 12 ; par2 = Triple ; par3 = multiplicative ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
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