jacobnzw / SSMToybox

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

Subclasses of Transition Model #22

Open jacobnzw opened 3 years ago

jacobnzw commented 3 years ago

Problem

Having one class TransitionModel for both discrete and continuous simulation is messed up, because one has to have two methods (discrete and continuous) for dynamics functions, for Jacobians and for simulations. This creates confusion when subclassing TransitionModel for the user: should I implement dyn_fcn_cont in addition to dyn_fcn? Not to mention the same holds for Jacobians and simulation functions. And the class has to support discrete and continuous SDE simulation - not good!

Solution

Create subclasses of TransitionModel for discrete and continuous simulation, such as DiscreteTimeTransitionModel and ContinousTimeTransitionModel, and move the dynamics specification and the simulation routines there. The common functionality, such as setting of initial condition random variable and noise random variable, can remain in the parent class TransitionModel.

Classes and their method could look something like this:

TransitionModel