rlabbe / filterpy

Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
MIT License
3.22k stars 612 forks source link

remove unused compute_log_likelihood parameter in kalman_filter.py #294

Open nolan-h-hamilton opened 8 months ago

nolan-h-hamilton commented 8 months ago

The compute_log_likelihood parameter, listed in the documentation and kalman_filter.py docstrings, is not supported, and an Exception is raised if it is invoked when defining a KalmanFilter(). Error reproduced below.

Python 3.8.18 (default, Sep 11 2023, 08:17:33) 
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from filterpy.kalman import KalmanFilter
>>> KalmanFilter(dim_x=2,dim_z=1)
KalmanFilter object
dim_x = 2
dim_z = 1
dim_u = 0
x = [[0. 0.]].T
P = [[1. 0.]
     [0. 1.]]
x_prior = [[0. 0.]].T
P_prior = [[1. 0.]
           [0. 1.]]
x_post = [[0. 0.]].T
P_post = [[1. 0.]
          [0. 1.]]
F = [[1. 0.]
     [0. 1.]]
Q = [[1. 0.]
     [0. 1.]]
R = [[1.]]
H = [[0. 0.]]
K = [[0. 0.]].T
y = [[0.]]
S = [[0.]]
SI = [[0.]]
M = [[0.]]
B = None
z = [[None]]
log-likelihood = -708.3964185322641
likelihood = 2.2250738585072014e-308
mahalanobis = 0.0
alpha = 1.0
inv = <function inv at 0x7f7f601f81f0>
>>> 
>>> 
>>> KalmanFilter(dim_x=2,dim_z=1,compute_log_likelihood=False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'compute_log_likelihood'
>>>