This affects research code. Usually, the expected model variance (emv) is a tiny number, so I don't expect the results to be dramatically affected and the conclusion of the research will be unchanged.
The error is in the quadratic form. We need y_e.dot(iK).dot(y_e) for all e, which should yield a vector of values! Not a matrix as it is now. This can be fixed with np.einsum().
Also, note the -2 in the numerator and denominator. In the fusion paper, the posterior TP covariance (eq. 32) and the
filtered covariance in the t-filter (eq. 42) are expressed in terms of covariances. In the Michael Roth's technical note, the (eq. 5.4) is an expression for the filtered (conditional/posterior) scale matrix - not covariance. This expression, from Roth, is used in the _measurement_update(), which is expressed in terms of scale matrices.
Looks like there is a bug in the code in the
StudentProcessKalman
andStudentProcessStudent
. The output dimension argumentdim_out
is improperly set to 1. For example: https://github.com/jacobnzw/SSMToybox/blob/1e2a8fd0634f6d53a30e24c21465c8e32c88999b/ssmtoybox/ssinf.py#L831-L832This means that in the term
self.I_out
is of shape(1, 1)
, as per the following: https://github.com/jacobnzw/SSMToybox/blob/1e2a8fd0634f6d53a30e24c21465c8e32c88999b/ssmtoybox/bq/bqmtran.py#L58which then affects the computation of covariance in https://github.com/jacobnzw/SSMToybox/blob/1e2a8fd0634f6d53a30e24c21465c8e32c88999b/ssmtoybox/bq/bqmtran.py#L414-L415
This affects research code. Usually, the expected model variance (
emv
) is a tiny number, so I don't expect the results to be dramatically affected and the conclusion of the research will be unchanged.The EMV in the following line is computed wrong! https://github.com/jacobnzw/SSMToybox/blob/1e2a8fd0634f6d53a30e24c21465c8e32c88999b/ssmtoybox/bq/bqmod.py#L1158
The error is in the quadratic form. We need
y_e.dot(iK).dot(y_e)
for alle
, which should yield a vector of values! Not a matrix as it is now. This can be fixed withnp.einsum()
.Also, note the
-2
in the numerator and denominator. In the fusion paper, the posterior TP covariance (eq. 32) and the filtered covariance in the t-filter (eq. 42) are expressed in terms of covariances. In the Michael Roth's technical note, the (eq. 5.4) is an expression for the filtered (conditional/posterior) scale matrix - not covariance. This expression, from Roth, is used in the_measurement_update()
, which is expressed in terms of scale matrices.Need to verify this!