holtWinters() applies the Holt-Winters forecasting method to input tables.
The Holt-Winters method predicts
n seasonally-adjusted values for the
specified column at the specified interval. For example, if interval is six
3, results include three predicted values six
seasonality delimits the length of a seasonal pattern according to interval.
If the interval is two minutes (
4, then the
seasonal pattern occurs every eight minutes or every four data points.
If your interval is two months (
4, then the
seasonal pattern occurs every eight months or every four data points.
If data doesn’t have a seasonal pattern, set
Space values at even time intervals
holtWinters() expects values to be spaced at even time intervales.
To ensure values are spaced evenly in time,
holtWinters() applies the
- Data is grouped into time-based “buckets” determined by the interval.
- If a bucket includes many values, the first value is used.
- If a bucket includes no values, a missing value (
null) is added for that bucket.
holtWinters() uses the first value in each time bucket to run
the Holt-Winters calculation. To specify other values to use in the
aggregateWindow to normalize irregular times and apply
an aggregate or selector transformation.
holtWinters() applies the Nelder-Mead optimization
to include “fitted” data points in results when
withFit is set to
holtWinters() discards rows with null timestamps before running the
null values as missing data points and includes them
in the Holt-Winters calculation.
Function type signature
( <-tables: stream[A], interval: duration, n: int, ?column: string, ?seasonality: int, ?timeColumn: string, ?withFit: bool, ?withMinSSE: bool, ) => stream[B] where A: Record, B: Record
(Required) Number of values to predict.
(Required) Interval between two data points.
Return fitted data in results. Default is
Column to operate on. Default is
Column containing time values to use in the calculating.
Number of points in a season. Default is
Return minSSE data in results. Default is
minSSE is the minimum sum squared error found when optimizing the holt winters fit to the data. A smaller minSSE means a better fit. Examining the minSSE value can help understand when the algorithm is getting a good fit versus not.
Input data. Default is piped-forward data (
- Use holtWinters to predict future values
- Use holtWinters with seasonality to predict future values
- Use the holtWinters fitted model to predict future values
Use holtWinters to predict future values
import "sampledata" sampledata.int() |> holtWinters(n: 6, interval: 10s)
Use holtWinters with seasonality to predict future values
import "sampledata" sampledata.int() |> holtWinters(n: 4, interval: 10s, seasonality: 4)
Use the holtWinters fitted model to predict future values
import "sampledata" sampledata.int() |> holtWinters(n: 3, interval: 10s, withFit: true)
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.