R: Holt-Winters with daily data (forecast package)

前端 未结 1 1579
灰色年华
灰色年华 2020-12-21 15:12

In the following example, I am trying to use Holt-Winters smoothing on daily data, but I run into a couple of issues:

# generate some dummy daily data
mData          


        
1条回答
  •  隐瞒了意图╮
    2020-12-21 15:29

    hw requires a ts object not a zoo object. Use

    zooDataWeekly <- ts(mData[,2], frequency=7)
    

    Unless there is a good reason for specifying the model exactly, it is usually better to let R select the best model for you:

    fit <- ets(zooDataWeekly)
    fc <- forecast(fit)
    plot(fc)
    

    0 讨论(0)
提交回复
热议问题