Home » date » 2011 » Jan » 17 »

*Unverified author*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Mon, 17 Jan 2011 00:36:45 +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/Jan/17/t12952244751yji5ybo7rbcwfb.htm/, Retrieved Mon, 17 Jan 2011 01:34:38 +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/2011/Jan/17/t12952244751yji5ybo7rbcwfb.htm/},
    year = {2011},
}
@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 = {2011},
    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:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1590 1798 1935 1887 2027 2080 1556 1682 1785 1869 1781 2082 2571 1862 1938 1505 1767 1607 1578 1495 1615 1700 1337 1531 1623 1543 1640 1524 1429 1827 1603 1351 1267 1742 1384 1392 1649 1665 1526 1717 1391 1790 1472 1350 1704 1391 1190 1351 1160 1236 1444 1257 1193 1701 1428 1611 1431 1472 1240 1276
 
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' @ www.wessa.org


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.164888600957893
beta0
gamma0.935831558446131


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
1325712727.36765770059-156.367657700595
1418621947.59613217641-85.5961321764082
1519382011.76874730217-73.7687473021747
1615051551.61727961216-46.617279612163
1717671822.83793193396-55.8379319339645
1816071674.0136952126-67.0136952125954
1915781469.81426637944108.185733620563
2014951557.69931261097-62.6993126109683
2116151624.878224738-9.87822473800361
2217001697.998406739632.00159326036805
2313371626.18292959689-289.182929596887
2415311857.66913594275-326.66913594275
2516232127.0337177642-504.033717764204
2615431486.6238634066256.3761365933808
2716401562.4806152650677.519384734936
2815241226.45824506152297.541754938476
2914291502.8230712347-73.8230712347004
3018271363.14446839862463.855531601378
3116031386.97522905345216.024770946554
3213511363.54571120616-12.5457112061647
3312671468.06451244961-201.064512449613
3417421507.79397411524234.20602588476
3513841266.37601317584117.623986824156
3613921515.30572956633-123.305729566333
3716491657.14366050572-8.1436605057172
3816651535.83739880696129.162601193041
3915261640.84089407702-114.840894077023
4017171437.5603679682279.4396320318
4113911421.02264991676-30.0226499167643
4217901686.08073425484103.919265745155
4314721465.542616882296.45738311770879
4413501246.49527240177103.504727598233
4517041221.22122338486482.778776615138
4613911716.99787093542-325.997870935421
4711901304.43857637212-114.438576372124
4813511321.8632309272929.1367690727109
4911601564.97571868442-404.975718684415
5012361483.86560344915-247.865603449155
5114441346.8547867309897.1452132690233
5212571464.99408187112-207.994081871118
5311931172.3490245980120.6509754019937
5417011488.4625351671212.537464832899
5514281253.250997642174.749002357998
5616111153.58382086826457.41617913174
5714311438.69522909813-7.69522909813213
5814721243.30312460142228.696875398582
5912401102.68691746106137.313082538945
6012761264.0909385761111.9090614238919


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
611157.25632836129764.2234696207141550.28918710186
621257.78117658554857.5982000737751657.9641530973
631431.673813217041021.523272893081841.824353541
641292.04092888945879.9005625834121704.18129519548
651211.11628185114795.7238839211021626.50867978118
661677.706125238041231.323069317722124.08918115836
671376.85871814492942.527679295521811.18975699431
681444.72916648403999.3514955919841890.10683737607
691303.14915896263861.5283538826171744.76996404265
701288.30397275952841.2427262946371735.3652192244
711064.31959077632628.9226835794371499.71649797319
721097.47385209602887.7631119255161307.18459226653
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/Jan/17/t12952244751yji5ybo7rbcwfb/16u8p1295224604.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/17/t12952244751yji5ybo7rbcwfb/16u8p1295224604.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/Jan/17/t12952244751yji5ybo7rbcwfb/2sy3o1295224604.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/17/t12952244751yji5ybo7rbcwfb/2sy3o1295224604.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/Jan/17/t12952244751yji5ybo7rbcwfb/3xeku1295224604.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/17/t12952244751yji5ybo7rbcwfb/3xeku1295224604.ps (open in new window)


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