Double exponential smoothing (Holt's linear trend method) extends simple exponential smoothing by adding a second component to track the trend. Simple exponential smoothing (EMA) lags behind data with a trend because it only models the level. Holt's method maintains separate estimates for level and trend, allowing it to follow trending data much more closely.
Given a time series and smoothing parameters alpha (level) and beta (trend), compute the smoothed level at each time step.
Initialize: level_0 = series[0], trend_0 = series[1] - series[0]. Then for each t >= 1:
lt=α⋅yt+(1−α)(lt−1+bt−1)bt=β(lt−lt−1)+(1−β)bt−1Return the level values [l_0, l_1, ..., l_{n-1}].
Input:
series = [10, 20, 30], alpha = 0.5, beta = 0.5
Output:
[10.0, 20.0, 30.0]
The series has a perfect linear trend. With alpha=beta=0.5, the method tracks it exactly: l_1 = 0.520 + 0.5(10+10) = 20, l_2 = 0.530 + 0.5(20+10) = 30.
Input:
series = [5, 5, 5, 5], alpha = 0.9, beta = 0.1
Output:
[5.0, 5.0, 5.0, 5.0]
Constant series: initial trend is 0 and stays 0. Level stays at 5.0 regardless of alpha and beta.
Start with level = series[0] and trend = series[1] - series[0]. Store level in the result. Then loop from t=1: compute new_level, new_trend, update variables, and append new_level to the result.
The level update uses (level + trend) as the predicted value, blended with the actual observation. The trend update blends the observed trend change (new_level - old_level) with the previous trend.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number
Double exponential smoothing (Holt's linear trend method) extends simple exponential smoothing by adding a second component to track the trend. Simple exponential smoothing (EMA) lags behind data with a trend because it only models the level. Holt's method maintains separate estimates for level and trend, allowing it to follow trending data much more closely.
Given a time series and smoothing parameters alpha (level) and beta (trend), compute the smoothed level at each time step.
Initialize: level_0 = series[0], trend_0 = series[1] - series[0]. Then for each t >= 1:
lt=α⋅yt+(1−α)(lt−1+bt−1)bt=β(lt−lt−1)+(1−β)bt−1Return the level values [l_0, l_1, ..., l_{n-1}].
Input:
series = [10, 20, 30], alpha = 0.5, beta = 0.5
Output:
[10.0, 20.0, 30.0]
The series has a perfect linear trend. With alpha=beta=0.5, the method tracks it exactly: l_1 = 0.520 + 0.5(10+10) = 20, l_2 = 0.530 + 0.5(20+10) = 30.
Input:
series = [5, 5, 5, 5], alpha = 0.9, beta = 0.1
Output:
[5.0, 5.0, 5.0, 5.0]
Constant series: initial trend is 0 and stays 0. Level stays at 5.0 regardless of alpha and beta.
Start with level = series[0] and trend = series[1] - series[0]. Store level in the result. Then loop from t=1: compute new_level, new_trend, update variables, and append new_level to the result.
The level update uses (level + trend) as the predicted value, blended with the actual observation. The trend update blends the observed trend change (new_level - old_level) with the previous trend.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number