jacobnzw / SSMToybox

Nonlinear Sigma-Point Kalman Filters based on Bayesian Quadrature
MIT License
12 stars 0 forks source link

Bugs in TPQStudent #15

Closed jacobnzw closed 5 years ago

jacobnzw commented 5 years ago

StudentModel.exp_model_variance() incorrectly computes the quadratic form term y_e * K^-1 * y_e^T, for e = 1, ..., E, where E is output dimensionality.

This code

fcn_obs.dot(self.iK).dot(fcn_obs.T)

produces an (E, E) matrix. We need a vector though, which can be produced by

np.einsum('ik,kj,ji->i', fcn_obs, self.iK, fcn_obs.T)
jacobnzw commented 5 years ago

TPQStudent.__init__():

Dictionaries are passed by reference, so in this case

if point_par is None:
    point_par = dict()
point_par_dyn = point_par
point_par_obs = point_par
point_par_dyn.update({'dof': q_dof})
point_par_obs.update({'dof': r_dof})

point_par_dyn and point_par_obs point to the same dictionary and hence the second update overwrites the first one.

Fix using copy

point_par_dyn = point_par.copy()
point_par_obs = point_par.copy()