[R] Holt Winters Error

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Apr 30 19:50:39 CEST 2003


That's a very short series to expect to fit a seasonal HW model to whilst
choosing the degree of smoothing. and the optimization code is failing,
because the initial guesses are too far away.

The following should give you a clue:

HoltWinters(test5, seasonal = "additive") 

Smoothing parameters:
 alpha:  1 
 beta :  0.8108822 
 gamma:  1 

and using alpha=1 will work with the multiplicative model too.

You can edit the function and choose other starting values than c(0.3,
0.1, 0.1) and thereby get it to converge, but I would have little
confidence in the values found.

On Wed, 30 Apr 2003, Kel wrote:

> Here's the time series (Jan 1994 - Dec 1998)
> 
> > test5
> 
> Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep  
> Oct   Nov   Dec
> 1994  16.0  17.4  19.2  21.4  24.0  27.0  29.0  29.4 
> 29.4  29.0  28.2  27.0
> 1995  28.0  31.8  36.0  40.6  45.6  51.0  53.0  51.0 
> 48.6  45.8  42.6  39.0
> 1996  40.0  46.2  52.8  59.8  67.2  75.0  77.0  72.6 
> 67.8  62.6  57.0  51.0
> 1997  52.0  60.6  69.6  79.0  88.8  99.0 101.0  94.2 
> 87.0  79.4  71.4  63.0
> 1998  64.0  75.0  86.4  98.2 110.4 123.0 125.0 115.8
> 106.2  96.2  85.8  75.0
> 
> > HoltWinters(test5,seasonal="mult")
> 
> Here's the message I get:
> 
> Error in optim(c(0.3, 0.1, 0.1), error, method =
> "L-BFGS-B", lower = c(0,  : 
> L-BFGS-B needs finite values of fn"
> 
> Thanks again.
> 
> 
> 
> 
> 
> --- Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> > That's not an error, but a line of R code.
> > 
> > If you could post an example which generates the
> > error and the actual 
> > error message, we could try to investigate it.
> > 
> > On Tue, 29 Apr 2003, Kel wrote:
> > 
> > > I have come across with the following error while
> > > running HoltWinters().
> > > 
> > > optim(c(0.3, 0.1, 0.1), error, method =
> > "L-BFGS-B", 
> > > lower = c(0, 0, 0), upper = c(1, 1, 1))
> > > 
> > > It only happens to multiplicative seasonality but
> > not
> > > additive.  I read the program but still couldn't
> > > understand it.  
> > 
> > -- 
> > Brian D. Ripley,                 
> > ripley at stats.ox.ac.uk
> > Professor of Applied Statistics, 
> > http://www.stats.ox.ac.uk/~ripley/
> > University of Oxford,             Tel:  +44 1865
> > 272861 (self)
> > 1 South Parks Road,                     +44 1865
> > 272866 (PA)
> > Oxford OX1 3TG, UK                Fax:  +44 1865
> > 272595
> > 
> 
> 
> __________________________________
> Do you Yahoo!?

> http://search.yahoo.com
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list