Alison
Alison

Reputation: 11

Holt function error

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.

Upvotes: 0

Views: 192

Answers (1)

Rob Hyndman
Rob Hyndman

Reputation: 31820

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

Check the class of your timeseries.

Upvotes: 1

Related Questions