0

I want to use holt() function on R, and apply it on a time series ts. But I get this error and don't understand why:

holt(timeseries)

Error in etsTargetFunctionInit(par = par, y = y, nstate = nstate, errortype = errortype, : Not compatible with requested type: [type=character; target=double]. In addition: Warning message: In is.constant(y) : NAs introduced by coercion

I get the same error when I try other forecasting functions like thetaf and ses.

Alison
  • 11
  • 1
  • 5

1 Answers1

1

The error message suggests that it expects a numerical vector, but you are providing a character vector.

Check the class of your timeseries.

Rob Hyndman
  • 30,301
  • 7
  • 73
  • 85