Documentation

holtWinters() function

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 minutes (6m) and n is 3, results include three predicted values six minutes apart.

Seasonality

seasonality delimits the length of a seasonal pattern according to interval. If the interval is two minutes (2m) and seasonality is 4, then the seasonal pattern occurs every eight minutes or every four data points. If your interval is two months (2mo) and seasonality is 4, then the seasonal pattern occurs every eight months or every four data points. If data doesn’t have a seasonal pattern, set seasonality to 0.

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 following rules:

  • 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.

By default, holtWinters() uses the first value in each time bucket to run the Holt-Winters calculation. To specify other values to use in the calculation, use aggregateWindow to normalize irregular times and apply an aggregate or selector transformation.

Fitted model

holtWinters() applies the Nelder-Mead optimization to include “fitted” data points in results when withFit is set to true.

Null timestamps

holtWinters() discards rows with null timestamps before running the Holt-Winters calculation.

Null values

holtWinters() treats 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

For more information, see Function type signatures.

Parameters

n

(Required) Number of values to predict.

interval

(Required) Interval between two data points.

withFit

Return fitted data in results. Default is false.

column

Column to operate on. Default is _value.

timeColumn

Column containing time values to use in the calculating. Default is _time.

seasonality

Number of points in a season. Default is 0.

withMinSSE

Return minSSE data in results. Default is false.

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.

tables

Input data. Default is piped-forward data (<-).

Examples

Use holtWinters to predict future values

import "sampledata"

sampledata.int()
    |> holtWinters(n: 6, interval: 10s)

View example input and output

Use holtWinters with seasonality to predict future values

import "sampledata"

sampledata.int()
    |> holtWinters(n: 4, interval: 10s, seasonality: 4)

View example input and output

Use the holtWinters fitted model to predict future values

import "sampledata"

sampledata.int()
    |> holtWinters(n: 3, interval: 10s, withFit: true)

View example input and output


Was this page helpful?

Thank you for your feedback!


InfluxDB 3.9: Performance upgrade preview

InfluxDB 3 Enterprise 3.9 includes a beta of major performance upgrades with faster single-series queries, wide-and-sparse table support, and more.

InfluxDB 3 Enterprise 3.9 includes a beta of major performance and feature updates.

Key improvements:

  • Faster single-series queries
  • Consistent resource usage
  • Wide-and-sparse table support
  • Automatic distinct value caches for reduced latency with metadata queries

Preview features are subject to breaking changes.

For more information, see:

Telegraf Enterprise now in public beta

Get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

See the Blog Post

The upcoming Telegraf Enterprise offering is for organizations running Telegraf at scale and is comprised of two key components:

  • Telegraf Controller: A control plane (UI + API) that centralizes Telegraf configuration management and agent health visibility.
  • Telegraf Enterprise Support: Official support for Telegraf Controller and Telegraf plugins.

Join the Telegraf Enterprise beta to get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

For more information:

Telegraf Controller v0.0.6-beta now available

Telegraf Controller v0.0.6-beta is now available with new features, improvements, and bug fixes.

View the release notes
Download Telegraf Controller v0.0.6-beta

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On May 27, 2026, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2