Holt's double exponential smoothing tracks both the current level and a linear trend. Initialize the level with the first observation and the trend with the difference between the first two observations.
Update the level at each later time:
ℓt=αyt+(1−α)(ℓt−1+bt−1)Then update the trend:
bt=β(ℓt−ℓt−1)+(1−β)bt−1In these equations, the observation is the current input value, the level is its smoothed estimate, and the trend is the smoothed rate of change. Alpha controls level smoothing, while beta controls trend smoothing. Return all level values, including the initial level.
Input: series = [10, 20, 30], alpha = 0.5, beta = 0.5
Output: [10, 20.0, 30.0]
Explanation: The initialized trend is 10, so both updates follow this perfectly linear series.
Input: series = [5, 5, 5, 5], alpha = 0.9, beta = 0.1
Output: [5, 5.0, 5.0, 5.0]
Store the old level until both update equations have been evaluated.
Append the initial level before looping from index 1.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number
Holt's double exponential smoothing tracks both the current level and a linear trend. Initialize the level with the first observation and the trend with the difference between the first two observations.
Update the level at each later time:
ℓt=αyt+(1−α)(ℓt−1+bt−1)Then update the trend:
bt=β(ℓt−ℓt−1)+(1−β)bt−1In these equations, the observation is the current input value, the level is its smoothed estimate, and the trend is the smoothed rate of change. Alpha controls level smoothing, while beta controls trend smoothing. Return all level values, including the initial level.
Input: series = [10, 20, 30], alpha = 0.5, beta = 0.5
Output: [10, 20.0, 30.0]
Explanation: The initialized trend is 10, so both updates follow this perfectly linear series.
Input: series = [5, 5, 5, 5], alpha = 0.9, beta = 0.1
Output: [5, 5.0, 5.0, 5.0]
Store the old level until both update equations have been evaluated.
Append the initial level before looping from index 1.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number