)
Unlike the KalmanLinearEstimator, this simply fits a line to the observations and reports the slope.
Public Member Functions | |
LinearFitEstimator () | |
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. |
w2img::LinearFitEstimator::LinearFitEstimator | ( | ) |
float w2img::LinearFitEstimator::getRateOfChange | ( | ) | const |
get the slope of the fitted line.
float w2img::LinearFitEstimator::getValue | ( | ) | const |
get an estimate of last value
void w2img::LinearFitEstimator::update | ( | float | z_k, | |
int | MAXIMUM_HISTORY = 5 | |||
) |
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.