jacobnzw / SSMToybox

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

Filter classes shouldn't check noise additivity #11

Closed jacobnzw closed 5 years ago

jacobnzw commented 5 years ago

The following lines appear in every single filter class

nq = dyn.dim_in if dyn.noise_additive else dyn.dim_in + dyn.dim_noise
nr = dyn.dim_in if obs.noise_additive else dyn.dim_in + obs.dim_noise

These just serve to determine which input dimensionality should be supplied to the transforms, which happens next, for example:

t_dyn = GaussianProcessTransform(nq, dyn.dim_out, kern_par_dyn, kernel, points, point_hyp)
t_obs = GaussianProcessTransform(nr, obs.dim_out, kern_par_obs, kernel, points, point_hyp)

Determining proper input dimensions based on noise additivity should be done inside the TransitionModel and MeasurementModel.

A more drastic solution would rework the transforms to take in TransitionModel/MeasurementModel directly. This would mean that apply() would no longer have to take the function handle as input, and the StateSpaceInference._time_update() would have to be modified accordingly.