Stone-Soup
Stone-Soup copied to clipboard
Singular Covariance in Motion Model causes issue with Model.pdf()
If the Discrete Time (Bar-Shalom terminology) covariance models are used (as apposed to the Discretized / Continuous Time version) then if the Time increment is set to 1 sec this leads to a singular covariance matrix for the transition model. Calling Model.pdf() then raises a Singular Matrix exception.
Here's an explicit example - for the Constant Velocity model the covariance matrix has the form:
$$ Q = \begin{bmatrix}\frac{1}{4}T^4 & \frac{1}{2}T^3 \ \frac{1}{2}T^3 & T^2 \end{bmatrix} \sigma^2 $$
Setting $T=1$ gives:
$$ Q = \begin{bmatrix}\frac{1}{4} & \frac{1}{2} \ \frac{1}{2} & 1 \end{bmatrix} \sigma^2 $$
Since the 2nd row is twice the first row the matrix is singular and thus the exception gets raised. Changing to a different Time Increment alleviates the issue.
Notes:
- The Discrete Time Constant Acceleration model also has the same issue
- The Discretized Continuous Time models do not have this issue due to their different scaling
- I'm not sure where else this issue may cause problems - Particle Filters, Initiators, Data Associators?