critical_damping_parameters¶
Copyright 2015 Roger R Labbe Jr.
FilterPy library. http://github.com/rlabbe/filterpy
Documentation at: https://filterpy.readthedocs.org
Supporting book at: https://github.com/rlabbe/KalmanandBayesianFiltersinPython
This is licensed under an MIT license. See the readme.MD file for more information.

filterpy.gh.
critical_damping_parameters
(theta, order=2)[source]¶ Computes values for g and h (and k for ghk filter) for a critically damped filter.
The idea here is to create a filter that reduces the influence of old data as new data comes in. This allows the filter to track a moving target better. This goes by different names. It may be called the discounted leastsquares gh filter, a fadingmemory polynomal filter of order 1, or a critically damped gh filter.
In a normal leastsquares filter we compute the error for each point as
\[\epsilon_t = (z\hat{x})^2\]For a crically damped filter we reduce the influence of each error by
\[\theta^{ti}\]where
\[0 <= \theta <= 1\]In other words the last error is scaled by theta, the next to last by theta squared, the next by theta cubed, and so on.
Parameters:  theta : float, 0 <= theta <= 1
scaling factor for previous terms
 order : int, 2 (default) or 3
order of filter to create the parameters for. g and h will be calculated for the order 2, and g, h, and k for order 3.
Returns:  g : scalar
optimal value for g in the gh or ghk filter
 h : scalar
optimal value for h in the gh or ghk filter
 k : scalar
optimal value for g in the ghk filter
References
Brookner, “Tracking and Kalman Filters Made Easy”. John Wiley and Sons, 1998.
Polge and Bhagavan. “A Study of the ghk Tracking Filter”. Report No. RECR761. University of Alabama in Huntsville. July, 1975
Examples
from filterpy.gh import GHFilter, critical_damping_parameters g,h = critical_damping_parameters(0.3) critical_filter = GHFilter(0, 0, 1, g, h)