class Prognosium::Adaptive::McKanzee
Constants
- PARAMS
Attributes
fi[R]
Public Class Methods
new(options)
click to toggle source
Calls superclass method
Prognosium::Adaptive::Holt::new
# File lib/prognosium/adaptive/mc_kanzee.rb, line 8 def initialize(options) @fi = options[:fi] || PARAMS[:fi] super end
Public Instance Methods
calc_smoothed(data_value, prev_smoothed, prev_trend)
click to toggle source
# File lib/prognosium/adaptive/mc_kanzee.rb, line 13 def calc_smoothed(data_value, prev_smoothed, prev_trend) alpha * data_value + (1 - alpha) * (prev_smoothed + prev_trend) * fi end
calc_trend(smoothed_value, prev_smoothed, prev_trend)
click to toggle source
# File lib/prognosium/adaptive/mc_kanzee.rb, line 17 def calc_trend(smoothed_value, prev_smoothed, prev_trend) beta * (smoothed_value - prev_smoothed) + (1 - beta) * prev_trend * fi end
predicted_formula(index)
click to toggle source
# File lib/prognosium/adaptive/mc_kanzee.rb, line 21 def predicted_formula(index) smoothed.last + trend.last * index * fi end