R forecast.holtwinters in forecast package not found

Viewed 15245

I am trying to use the forecast.holtwinters function and when I try to run it:

dftimeseriesforecast <- forecast.HoltWinters(data, h=65)

I get this error:

Error: could not find function "forecast.HoltWinters"

I have also tried this:

 dftimeseriesforecast= forecast::forecast.HoltWinters(data, h=65)

But I get this error message:

Error: 'forecast.HoltWinters' is not an exported object from 'namespace:forecast'

I look at this list of functions in the forecast package using this code:

ls("package:forecast")

and this returns:

[1] "%>%" "accuracy" "Acf" "arfima" "Arima" "arima.errors" "arimaorder" "auto.arima"
[9] "autolayer" "baggedETS" "bats" "bizdays" "bld.mbb.bootstrap" "BoxCox" "BoxCox.lambda" "Ccf"
[17] "checkresiduals" "croston" "CV" "CVar" "dm.test" "dshw" "easter" "ets"
[25] "findfrequency" "forecast" "forecast.ets" "fourier" "fourierf" "gas" "geom_forecast" "GeomForecast"
[33] "getResponse" "ggAcf" "ggCcf" "gghistogram" "gglagchull" "gglagplot" "ggmonthplot" "ggPacf"
[41] "ggseasonplot" "ggsubseriesplot" "ggtaperedacf" "ggtaperedpacf" "ggtsdisplay" "gold" "holt" "hw"
[49] "InvBoxCox" "is.acf" "is.Arima" "is.baggedETS" "is.bats" "is.constant" "is.ets" "is.forecast"
[57] "is.mforecast" "is.nnetar" "is.nnetarmodels" "is.splineforecast" "is.stlm" "ma" "meanf" "monthdays"
[65] "msts" "na.interp" "naive" "ndiffs" "nnetar" "nsdiffs" "Pacf" "remainder"
[73] "rwf" "seasadj" "seasonal" "seasonaldummy" "seasonaldummyf" "seasonplot" "ses" "sindexf"
[81] "snaive" "splinef" "StatForecast" "stlf" "stlm" "taperedacf" "taperedpacf" "taylor"
[89] "tbats" "tbats.components" "thetaf" "trendcycle" "tsclean" "tsCV" "tsdisplay" "tslm"
[97] "tsoutliers" "wineind" "woolyrnq"

Does anyone know what is going on? I've used this before and had no problems. I'm using forecast version 8.1.

5 Answers

Use like this:

forecast:::forecast.HoltWinters().

It will work.

you can try belows code,it will work. you need not HoltWinters.forecast.

    dftimeseries.hw <- HoltWinters(data)
    dftimeseries.forecast <-forecast(dftimeseries.hw,h=65)

Use:

forecast_data <-forecast(mydata #data name,h=56)

after updating your r version and it will work

Related