Class: TeaLeaves::ExponentialSmoothingForecast::MultiplicativeSeasonalityStrategy
Instance Attribute Summary
#start_index
Instance Method Summary
collapse
#initialize, #new_values
Instance Method Details
#apply(forecast, parameters, n) ⇒ Object
44
45
46
47
|
# File 'lib/tealeaves/exponential_smoothing_forecast.rb', line 44
def apply(forecast, parameters, n)
index = (n - 1) % parameters[:seasonality].size
forecast * parameters[:seasonality][index]
end
|
#p(value, params) ⇒ Object
36
37
38
|
# File 'lib/tealeaves/exponential_smoothing_forecast.rb', line 36
def p(value, params)
value / params[:seasonality].first
end
|
#t(value, new_level) ⇒ Object
40
41
42
|
# File 'lib/tealeaves/exponential_smoothing_forecast.rb', line 40
def t(value, new_level)
value / new_level
end
|