Open mrcfon opened 6 months ago
I tested the IPLS based on the UKF filter rather IPLF, but I got the same error just a few time steps later.
According to Angel:
Setting the prior at time step k=0, predict to k=1, get the first measurement and we update --> should work.
Setting the prior and the first measurement both at k=0 --> may create problems, unless we do the extra prediction (ask Ben).
The same error was encountered using AER.
Update: the error (Matrix is not positive definite) occurs using any measurement model (CartesianToElevationBearingRangeRate, CartesianToMonostatic, CartesianToTelescope) with measurement gaps.
I'm trying to understand why the IPLF and IPLS return weird results if I set q_value = 5e-9 (it was previously set to q = 0.02). I'm using the CartesianToElevationBearingRangeRate measurement model from the Stone Soup library at the moment. The code I'm using is available here. I tested a few things:
While I originally tested the scenario with a measurement gap, I simplified it assuming we receive a measurement at each time step. See the scenario below.
This is the result I get setting the number of iterations for IPLF to 5:
If I set the number of iterations for IPLF to 1 I get: This is the Euclidian distance of the algorithms in this case
Iterating IPLF 5 times instead of just once brings down the error of IPLS from 1e15 to 1e8. I'll try to see what happens if I replace IPLF with one iteration with UFK from the Stone Soup library. Any other suggestions @narykov?
I plotted the angles and they look fine.
Are these the measurements you've generated? How about the predicted angles we discussed yesterday? Do they look OK?
I think there is no point looking into smoothing results because filtering does not look OK in Figure 3. The smoothing results also tend to obscure the plots, e.g., little can be said about the IPLF performance in the last plot.
I’m trying to understand why the second iteration of IPLS doesn’t run on the TLE scenarios with measurement gaps. It seems that the UKF smoother used in the first iteration of IPLS returns “bad“ covariance matrices, so the proper IPLS breaks due to a incorrect input. Here are some facts:
The next step would be to test the UKF smoother in a linear scenario (without GODOT) with measurement gaps. Any other suggestions?
IPLS may return errors at the second iteration (the first after UKF smoothing) even in a scenario with no measurement gaps. Note that there was a manoeuvre in this scenario. Here is the error:
IPLS iteration 1 out of 2 IPLS iteration 2 out of 2 Traceback (most recent call last): File "/home/mrcfon/workspace/space_manoeuvres/stonesoup/space_manoeuvres/STT_noDA_GODOT_TLEs.py", line 201, in <module> main() File "/home/mrcfon/workspace/space_manoeuvres/stonesoup/space_manoeuvres/STT_noDA_GODOT_TLEs.py", line 163, in main track_ipls = IPLSKalmanSmoother(transition_model=transition_model, n_iterations=n_iterations_ipls).smooth( File "/home/mrcfon/workspace/space_manoeuvres/stonesoup/robusstod/stonesoup/smoother.py", line 137, in smooth smoothed_track = KalmanSmoother(transition_model=None).smooth(track_forward) # <- this triggers UKF?? File "/home/mrcfon/workspace/space_manoeuvres/stonesoup/smoother/kalman.py", line 183, in smooth ksmooth_gain = self._smooth_gain( File "/home/mrcfon/workspace/space_manoeuvres/stonesoup/smoother/kalman.py", line 150, in _smooth_gain @ np.linalg.inv(prediction.covar) File "/home/mrcfon/workspace/space_manoeuvres/myenv/lib/python3.10/site-packages/numpy/linalg/linalg.py", line 561, in inv ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj) File "/home/mrcfon/workspace/space_manoeuvres/myenv/lib/python3.10/site-packages/numpy/linalg/linalg.py", line 112, in _raise_linalgerror_singular raise LinAlgError("Singular matrix") numpy.linalg.LinAlgError: Singular matrix
Thanks for the update. Do you encounter this error despite changing how the measurement prediction works in the update step?
IPLS breaks for not definite positive covariance matrix error using AE measurement model in scenarios with measurement gaps. The error happens at the second iteration of IPLS (the one after UKF smoother) because the results of UKF smoother are not good.