2
$\begingroup$

I'm trying to replicate some values from a holt winters calculation made in excel by someone else. I have the time series time_x, and I'm using the forecast package.

The problem is when I run the command hw using the same parameters this error occur:

>hw(y = time_x,h = 24,seasonal = "additive",alpha = 0.1, beta = 0.6, gamma = 0.05)

[1] "Model: ETS(A,A,A)" Error in etsmodel(y, errortype[i], trendtype[j], seasontype[k], damped[l], : Parameters out of range

Aren't all parameters between 0 and 1?

$\endgroup$
1
  • $\begingroup$ It could mean that the ets function tries to optimize the phi parameter and fails to get it within the bounds 0.8 and 1. You could try to specify this parameter in the hw() or change the bounds in ets() $\endgroup$ Jul 11, 2017 at 21:48

1 Answer 1

1
$\begingroup$

These are the conditions you need to follow (or use bounds="admissible" in the function call):

in your case you have $\beta>\alpha$, which triggers the check.param function to return 0

check.param <- function(alpha,beta,gamma,phi,lower,upper,bounds,m)
{
  if(bounds != "admissible")
  {
    if(!is.null(alpha))
    {
      if(alpha < lower[1] | alpha > upper[1])
        return(0)
    }
    if(!is.null(beta))
    {
      if(beta < lower[2] | beta > alpha | beta > upper[2])
        return(0)
    }
    if(!is.null(phi))
    {
      if(phi < lower[4] | phi > upper[4])
        return(0)
    }
    if(!is.null(gamma))
    {
      if(gamma < lower[3] | gamma > 1-alpha | gamma > upper[3])
        return(0)
    }
  }
  if(bounds != "usual")
  {
    if(!admissible(alpha,beta,gamma,phi,m))
      return(0)
  }
  return(1)
}    

from the source code https://github.com/robjhyndman/forecast/blob/master/R/ets.R

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.