Search code examples
juliaodekalman-filterautomatic-differentiation

Is Julia ForwardDiff applicable to very comprehensive function involving ODE integration and nested automatic differentiation?


I need to estimate parameters of continuous-discrete nonlinear stochastic dynamic system using Kalman filtering techniques.

I'm going to use Julia ode45() from ODE and implement Extended Kalman Filter by myself to compute loglikelihood. ODE is written fully in Julia, ForwardDiff supports differentiation of native Julia functions, including nested differentiation, that's what I also need cause I want to use ForwardDiff in my EKF implementation.

Will ForwardDiff handle differentiation of such a comprehensive function like the loglikelihood I've described?


Solution

  • ODE.jl is in maintenance mode so I would recommend using DifferentialEquations.jl instead. In the DiffEq FAQ there is an explanation about using ForwardDiff through the ODE solvers. It works, but as in the FAQ I would recommend using sensitivity analysis since that's a better way of calculating the derivatives (it will take a lot less compilation time). But yes, DiffEqParamEstim.jl is a whole repository for parameter estimation of ODEs/SDEs/DAEs/DDEs and it uses ForwardDiff.jl through the solvers.

    (BTW, what you're looking to do sounds interesting. Feel free to get in touch with us in the JuliaDiffEq channel to talk about the development of parameter estimation tooling!)