Package: rodeo
rodeo:Probabilistic ODE SolverMohan Wu, Martin LysyDescriptionrodeois a fast and flexible Python front-end library with a Fortran/C++ back-end that usesprobabilistic numericsto solve ordinary differential equations (ODEs).  That is, most ODE solvers (such asEuler's method) produce a deterministic approximation to the ODE on a grid of sizedelta.  Asdeltagoes to zero, the approximation converges to the true ODE solution.  Probabilistic solvers such asrodeoalso output a solution an a grid of sizedelta; however, the solution is random.  Still, asdeltagoes to zero, the probabilistic numerical approximation converges to the true solution.rodeoimplements the probabilistic solver ofChkrebtii et al (2016). This begins by putting aGaussian processprior on the ODE solution, and updating it sequentially as the solver steps through the grid. The user-facing interface is written in Python to allow for a wide appeal. The back-end is a time-varying Kalman filter implemented in C++ and Fortran using state-of-the-art linear algrebra routines foundhere.rodeois 10-40x faster than a pure Python implementation, achieving comparable speeds to the widely-used deterministic solverodeinin theScipylibrary. Various low-level backends are provided in the following modules:rodeo.cython: This module performs the underlying linear algebra using the BLAS/LAPACK routines provided by NumPy through a Cython interface.
To maximize speed, no input checks are provided.  All inputs must befloat64NumPy arrays inFortranorder.rodeo.eigen: This module uses the C++ Eigen library for linear algebra.  The interface is also through Cython.Here again we have the same input requirements and lack of checks.  Eigen is known to be faster than most BLAS/LAPACK implementations,
but it needs to be compiled properly to achieve maximum performance.  In particular this involves linking against an installed version of Eigen (not provided)
and setting the right compiler flags for SIMD and OpenMP support.  Some defaults are provided insetup.py, but tweaks may be required depending on the user's system.rodeo.numba: This module once again uses BLAS/LAPACK but the interface is through Numba.  Here input checks are performed and the inputs can be
in either C or Fortran order, and single or double precision (float32andfloat64).  However, C ordered arrays are first converted to Fortran order,
so the latter is preferable for performance considerations.InstallationDownload the repo from GitHub and then install with thesetup.pyscript:gitclonehttps://github.com/mlysy/rodeo.gitcdrodeo
pipinstall.Unit TestingThe unit tests are done against the deterministic ode solverodeintto ensure that the solutions are approximately equal. They can be ran through the following commands:cdtests
python-munittestdiscover-vExamplesWe provide four separate ODE problems as examples to demonstrate the capabilities ofrodeo. These examples are best viewed in theexamples/tutorial.ipynbjupyter notebook, hence extra installations are required.pipinstall.[examples]DocumentationThe HTML documentation can be compiled from thekalmantvroot folder:pipinstall.[docs]cddocs
makehtmlThis will create the documentation indocs/build.UsagePlease see the detailed example in the tutorialhere.  Running the tutorial compares the deterministic Euler solver to the probabilistic solver for the ODE initial value problemx(t)^{(2)} = sin(2t) - x_t^{(0)}
x(0)^{(1)} = 0
x(0)^{(0)} = -1The results for N = 50, 100, and 200 grid points for both solvers is shown below.rodeois also capable of performing parameter inference using the mode-quadrature approximation method. For example the two variateFitzHugh-Nagumomodel can be stated asV(t)^{(1)} = cV(t)^{(0)} - (V(t)^{(0)})^3/3 + R(t)^({0})
R(t)^{(1)} = -(V(t)^{(0)} - a + bR(t)^{(0)})/c
V^{(0)} = -1, R^{(0)} = 1where the parameter of interest istheta = (a,b,c). A comparison of the deterministic Euler solver to the probabilistic solver is shown below.