Class: TeaLeaves::ExponentialSmoothingForecast::AdditiveSeasonalityStrategy
Instance Attribute Summary
#start_index
Instance Method Summary
collapse
#initialize, #new_values
Instance Method Details
#apply(forecast, parameters, n) ⇒ Object
29
30
31
32
|
# File 'lib/tealeaves/exponential_smoothing_forecast.rb', line 29
def apply(forecast, parameters, n)
index = (n - 1) % parameters[:seasonality].size
forecast + parameters[:seasonality][index]
end
|
#p(value, params) ⇒ Object
21
22
23
|
# File 'lib/tealeaves/exponential_smoothing_forecast.rb', line 21
def p(value, params)
value - params[:seasonality].first
end
|
#t(value, new_level) ⇒ Object
25
26
27
|
# File 'lib/tealeaves/exponential_smoothing_forecast.rb', line 25
def t(value, new_level)
value - new_level
end
|