Coverage for src/gncpy/filters/qkf_gaussian_scale_mixture_filter.py: 94%

16 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-19 05:48 +0000

1from gncpy.filters.gsm_filter_base import GSMFilterBase 

2from gncpy.filters.quadrature_kalman_filter import QuadratureKalmanFilter 

3 

4 

5class QKFGaussianScaleMixtureFilter(GSMFilterBase): 

6 """Implementation of a QKF Gaussian Scale Mixture filter. 

7 

8 Notes 

9 ----- 

10 This is based on the derivation in 

11 :cite:`VilaValls2012_NonlinearBayesianFilteringintheGaussianScaleMixtureContext` 

12 but uses a QKF as the core filter instead of an SQKF. It should functionally 

13 be the same and provide the same results, however this should have better 

14 runtime performance at the cost of potential numerical problems with the 

15 covariance matrix. 

16 """ 

17 

18 def __init__(self, **kwargs): 

19 """Initialize the object.""" 

20 super().__init__(**kwargs) 

21 

22 self._coreFilter = QuadratureKalmanFilter() 

23 

24 @property 

25 def points_per_axis(self): 

26 """Wrapper for the number of quadrature points per axis.""" 

27 return self._coreFilter.quadPoints.points_per_axis 

28 

29 @points_per_axis.setter 

30 def points_per_axis(self, val): 

31 self._coreFilter.quadPoints.points_per_axis = val 

32 

33 def set_state_model(self, **kwargs): 

34 """Wrapper for the core filter; see :meth:`.QuadratureKalmanFilter.set_state_model` for details.""" 

35 super().set_state_model(**kwargs) 

36 

37 def set_measurement_model(self, **kwargs): 

38 """Wrapper for the core filter; see :meth:`.QuadratureKalmanFilter.set_measurement_model` for details.""" 

39 super().set_measurement_model(**kwargs) 

40