The grid (core) ยท console.warn
forecast: holtWinters needs a period (opts.period >= 2)
Printed by The grid (core), prefixed [lattice], since 1.40.0.
Warnings reference › forecast.holtWinters.period
- Identifier
forecast.holtWinters.period- Raised by
- The grid (core)
- Since
- 1.40.0
What happened
Holt-Winters models a repeating season and cannot do so without knowing how long the season is. With no usable period the forecast returns null - nothing is drawn and no series is produced.
The fix
Set period to the number of observations in one season: 12 for monthly data with a yearly cycle, 7 for daily data with a weekly one.
The smallest fix
grid.statistics.forecast({ col: 'sales', method: 'holtWinters', period: 12, horizon: 6 });
Reference
Covered in full at the API reference.