Unlike the KalmanLinearEstimator, this simply fits a line to the observations and reports the slope.
Public Member Functions
|void||update (float z_k, int MAXIMUM_HISTORY=5)|
|update the filter with an observation. |
|float||getValue () const|
|get an estimate of last value |
|float||getRateOfChange () const|
|get the slope of the fitted line. |
get the slope of the fitted line.
get an estimate of last value
|int|| MAXIMUM_HISTORY = |
update the filter with an observation.
Specify also how many previous observations should be used. This will automatically prune the list of observations held to that number. The default is to use 5 numbers.
If MAXIMUM_HISTORY is negative, an unlimited history will be used. WARNING: unlike the Kalman estimator, this is very expensive memory-wise since we have to store all the data. Also, unlike the Kalman estimator, there is no way for the moving average to place more weight on later observations, so a positive MAXIMUM_HISTORY is recommended.