Bayesian Filtering for ODEs with Bounded Derivatives

09/25/2017 ∙ by Emilia Magnani, et al. ∙ Max Planck Society 0

Recently there has been increasing interest in probabilistic solvers for ordinary differential equations (ODEs) that return full probability measures, instead of point estimates, over the solution and can incorporate uncertainty over the ODE at hand, e.g. if the vector field or the initial value is only approximately known or evaluable. The ODE filter proposed in recent work models the solution of the ODE by a Gauss-Markov process which serves as a prior in the sense of Bayesian statistics. While previous work employed a Wiener process prior on the (possibly multiple times) differentiated solution of the ODE and established equivalence of the corresponding solver with classical numerical methods, this paper raises the question whether other priors also yield practically useful solvers. To this end, we discuss a range of possible priors which enable fast filtering and propose a new prior--the Integrated Ornstein Uhlenbeck Process (IOUP)--that complements the existing Integrated Wiener process (IWP) filter by encoding the property that a derivative in time of the solution is bounded in the sense that it tends to drift back to zero. We provide experiments comparing IWP and IOUP filters which support the belief that IWP approximates better divergent ODE's solutions whereas IOUP is a better prior for trajectories with bounded derivatives.



There are no comments yet.


page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Ordinary differential equations (ODEs) are an extensively studied mathematical problem. Dynamical systems are described by ODEs, and the application of these extends to many different fields of science and engineering. Given the initial value proplem (IVP) on the time interval


with globally Lipschitz continuous, we want to compute a numerical approximation of the solution using a probabilistic approach. Solving ODEs is one of the major tasks of numerical mathematics. Classical numerical ODE solvers (e.g. Runge Kutta methods) construct the solution by iteratively evaluating the vector field at discrete times at numerical approximations and collecting information on the derivative . As pointed out in the past [12, 3, 10], to incorporate uncertainties that arise due to the inaccurate observation of and consequently accumulated numerical error, we can interpret the observed evaluations of as (potentially noisy) data for statistical inference. For quantifying the uncertainty on we model the analytic solution as a Gauss-Markov stochastic process defined on a probability space . The iterative algorithm then outputs the law of , i.e. the probability measure that the process induces on the collection of functions from to the state space . This probability measure contains the belief over .

From this viewpoint, unknown numerical quantities are modelled as random variables and numerical algorithms return probability distributions instead of points estimates. This is a probabilistic approach which carries out numerical computations in a statistically interpretable way by combining probability theory and numerics, and permits to quantify the uncertainties for the computations. This idea became a dynamic research area which includes optimization, linear algebra and differential equations and is called

Probabilstic Numerics (PN) [6].
A PN solver for ODEs was introduced by [5] who recast the inference of the solution as a Gaussian process (GP) regression. However, their original solver did not satisfy the polynomial convergence rates of classical solvers. In parallel development, [1] proposed a similar solver of similar structure, which uses a Monte Carlo, instead of a closed-form Gaussian, updating scheme. This solver produced solutions of linear order, but still not of polynomial order. In [15], the polynomial convergence rate was established by choosing an Integrated Wiener Process (IWP) prior. This solver was further amended by adding calibrated uncertainty quantification by Bayesian quadrature [9] and using the Markov property of the IWP to recast it as a filter, thereby drastically speeding up the probabilistic computations [9, 16]. While the resulting filter is the fastest probabilistic ODE solver available, it outputs solely Gaussian probability measures. Another novel method introduced in [2] provides a more flexible non-parametric uncertainty quantification by defining a generative process to sample random numerical solutions of the ODE, obtained by adding Gaussian noise to the solution of a classical solver. The computational cost of this method per sample, however, is equal to the cost of the underlying solver, which makes it impractical for cost-sensitive applications.
In this paper we recall the solver in [15, 9] which employs a -times integrated Wiener process prior on the solution and introduce instead an Integrated Ornstein Uhlenbeck (IOU) process prior. This new model improves the algorithm for ODEs whose trajectories have a higher derivative which is expected to gravitate back to zero. In the following, we will call such systems ’ODEs with bounded derivatives’.

2 Gaussian filtering for ODEs

2.1 Bayesian filtering problem

Assume we have a signal process which is not directly observable, solution of the stochastic differential equation (SDE)


where denotes a Wiener process. Instead, we can only see an observation process that is a transformation of . Both processes are defined on some probability space . The goal of the filtering problem is to compute, given the observations , the -optimal estimate of for . Accordingly, has to be measurable w.r.t. the natural filtration and minimize the mean-square distance between and the candidates in :


The best mean square estimate of given is known to be the conditional expectation [8, 11]. In a Bayesian spirit, we seek to compute the posterior distribution of given the current and previous noisy observations . This can be done by using Bayes’ rule


The distribution is the measurement model which describes the noisy relationship between the true signal and the observations, and is the prior containing preliminary information on before any observation are taken into account. A natural question is then: which prior should we put on the signal process

? Due to the computationally advantageous properties of Gaussian distributions which allow for fast inference by matrix computations we assume

to be a Gaussian process, i.e. to have finite joint Gaussian distribution. Moreover we want to iteratively update the solution from to without taking into account the previous observations at time steps . This is possible when is also a Markov process, since otherwise the computational cost per step would exponentially increase in the number of previous steps. Sample continuous Gauss-Markov processes can be written as the solution of the linear time-invariant stochastic differential equation (LTI-SDE) of the form


with Gaussian initial condition . The matrix is the so called drift matrix and is the diffusion matrix of the process. The solution of Eq. 5 depends on the form of and . With this conditions the distribution of the estimate

can be computed by Kalman filtering

[14], an iterative algorithmic implementation for the linear filtering problem with Gaussian model assumptions. Since it is essentially an application of Bayes’ rule, it is determined by the choice of the prior and the measurement model . Previous work [9, 15, 16] employed an IWP prior, discussed in Section 2.3, whereas in this paper we will analyse Bayesian filtering for ODEs with an IOUP prior. Due to the properties of Gaussian distributions, together with Gaussian measurement model assumptions, we can analytically compute the matrices for Gaussian filtering for LTI SDE like Eq. 5 (see [13]).

2.2 Filtering for ODEs

We use Bayesian filtering for computing a numerical estimation of the solution of the IVP Eq. 1. We treat the imprecise measurements as noisy observations. Since is a numerical approximation of the true solution at time the evaluations of are indeed noisy. Therefore, we model the solution and the first derivatives as a draw of a Gauss Markov stochastic process . Hence, the SDE in Eq. 5, which describes the dynamics of , has the following form


The drift matrix has non-zero entries only on the first-off diagonal and on the last row. This form of guarantees that the -th component is the derivative of the -component in the state space. The parameters determine the process employed on the -the component of the state space : they are all equal to zero for an integrated Wiener process, equal to zero apart from for the integrated OUP with some , whereas for the Matern process [4] we have . Inference in Eq. 6 with linear Gaussian measurements models gives rise to the Kalman Filter equations implemented in Algorithm 1. The algorithm outputs the filtering distribution , where .

1:  Choose , and Choose prior model
2:  Initialize , ,
3:  Choose
4:  Compute and
5:  for  to  do
6:      Predict
8:      Collect evaluations (’data’)
9:      Update
14:  end for
15:  return  
Algorithm 1 Kalman ODE filtering

The transition matrices and in lines 6-7 are given by ([13])


where and come from Eq. 6. The matrix is the measurement model matrix (in probabilistic terms ), in our case the -th unit vector . In line 1 a prior model is selected. Lines 6-7 compute the prediction distribution , which depends from the form of the matrices and and is therefore strictly related to the choice of the prior. Lines 9-13 are known as update step and compute the updated distribution . In the experiments we will assume for simplicity , i.e. the numerical approximation is exact.

2.3 Prior selection: Integrated Wiener process

The standard Brownian motion is a Gauss Markov process with mean

and variance

. Samples of the process are depicted in Fig. 1 (b). Previous work [9, 15, 16] worked with an IWP prior for probabilistic ODE solvers. In this case and are given by [15]


This work showed the useful uncertainty quantification for the solution with only a small computational overhead compared to classical numerical methods. In particular, Schober et al.[15] constructed a class of probabilistic solvers whose posterior mean have the same analytic structure of the one of the classic numerical Runge-Kutta methods (for first, second and third order), thus acquiring their good properties.

3 Ornstein Uhlenbeck process

Can we use other Gauss Markov priors over the solution which preserve good convergence rates? In this paper we model the solution function and the first derivatives as a draw from an integrated Ornstein Uhlenbeck process (IOUP) to perform inference in ODEs. We show that this model is competitive with the IWP solver discussed in the previous section. The Ornstein Uhlenbeck process (OUP) is a Gauss-Markov process whose dynamic is governed by the following SDE


where and denotes a standard Wiener process. The OUP converges to its stationary distribution in the sense that , for . The difference between the Wiener process and the Ornstein Uhlenbeck is the drift term , which is constant for the Wiener process and dependent on the parameter for OUP. If the current value of the process is smaller than the value of the mean , the drift is positive and the process tends to drift back to . The same (symmetric) effect occurs if the current value of is greater than . In other words, the samples evolve around the mean which acts as an equilibrium level. Some samples of the process are shown in Fig. 1 (a). This property is called ”mean reverting” and the magnitude of determines the strength of this drift. For small values of the effect vanishes, whereas, for large , stays close to the mean with high probability. This behaviour justifies the fact that the variance of the OUP is bounded, in fact bounded by , whereas the Wiener process variance is unbounded () and the samples don’t tend to remain around the mean.

(a) Samples of an Ornstein Uhlenbeck process with initial position , variance and .The samples tend to remain close to the mean (mean reverting property).
(b) Samples of a Wiener process with initial mean and variance . The samples do not ’drift back’ to the mean.
Figure 1:

3.1 Bayesian Filtering with Integrated Ornstein Uhlenbeck process

We analyse the probabilistic interpretation of ODEs by filtering investigated in Section 2.2 in the case of a -times integrated Ornstein Uhlenbeck process.
To this end, we a priori assume that the solution of the ODE and the first derivatives follow a -times integrated Ornstein Uhlenbeck process with initial conditions . Accordingly, the drift matrix in Eq. 6 has entries , , on the last row. Using this prior model the matrices and can be computed analytically (see appendix) from Eq. 7 and Eq. 8 and have the following form:


A probabilistic solver with IOUP prior has local convergence rate for the predicted posterior mean of the same order as the solver with an IWMP prior:

Proposition 1

The order of the prediction in the first step


for some constant independent of .


By writing the Taylor expansion of and subtracting it from Eq. 18, we obtain the desired order for the truncation error.

As mentioned above, we want to exploit of the ’mean reverting property’ of OUP (and absent in WP), or equivalently of the fact that OUP has bounded variance, for solving ODEs whose trajectories have bounded derivatives. Since we use a -times IOUP prior over the solution, we want that also the integral of the process is maintained the same behaviour, i.e. tends to stay closer to the mean than the WP. This is indeed the case, as we proved that (see appendix).

4 Experiments

In this section we analyse applications of the probabilistic ODE solver with IOUP prior discussed in Section 3.1. In particular we compare this solver with the one considered in Section 2.3, which uses an IWP prior over the solution , by applying the two probabilistic ODE solvers to the same ODEs and examining the plots. The experiments aim to test the intuition that the selection of the prior depends on the structure of the ODE’s solution: when the solution looks ’mean-reverting’, in the sense that it has bounded derivatives, we expect better results from the IOUP prior, whereas we should choose an IWP prior when solutions to ODEs have unbounded derivatives or look divergent. According to these considerations Table 1 shows our prior belief on which solver (IOUP or IWP) performs better for which of the following ODEs.

  • Linear ODEs

    • Exponential function

    • Negative exponetial function

  • Oscillators

    • Orbit equations [7]

      (epsilon is the eccentricity of the orbit)

    • Van der Pol oscillator

  • Moderate systems [7]


For the experiments the IOUP and IWP filters are initialized with mean and variance with non-zero entries only in the minor matrix where ord is the order of the ODE and

is the identity matrix.

ODE IWP-solver IOUP-solver
1. a) Exponential function
1. b) Negative exponential function
2. Oscillators
3. Moderate systems
Table 1: Expectations of which solver — IWP or IOUP— should work better on which ODE, based on the intuition described above

4.1 Linear ODEs

The solution of a), the exponential function, has a divergent trajectory with unbounded derivatives and as we expected the plot in Fig. 2 (a) shows that the IWP-prior solver approximates the solution better than the IOUP-prior. On the contrary, the negative exponential function, solution of b), decays to zero. This resembles the behaviour of the mean-reverting samples of the IOU process, which should therefore work as a good prior over . The plot in Fig. 2 (b) confirms this intuition: the IOUP-solver approximates better the solution than the IWP-solver. Both methods use a model of step size .
The plot in Fig. 2 (b) clearly shows the behaviour of the two solvers: IWP oscillates much more than IOUP around the solution when this converges to zero, because the IWP doesn’t tend to ’drift back’ to the mean, whereas the IOUP solver remains closer to the solution due to the process drifting property and smaller variance.

(a) Positive exponential, ,
(b) Negative exponential, ,
Figure 2: In red: IOUP-solver, in green: IWP-solver. In black the solution (computed with a Runge Kutta method with very small step size )

4.2 Oscillators

We used an IOUP-prior to compute approximate oscillating solutions of ODEs in Problem 2. a) and b). The original intuition was that an IOUP-solver would be a good prior for oscillators, because their trajectory resembles the ’mean-reverting’ property and looks similar to the samples of an OUP. However, we do not always see better results of the IOUP-approximate solution. Fig. 3 depicts two different oscillators: in the plot (a) the IWP solver distinctly approximates better the solution in Problem 2 a). On the other hand the Van der Pol oscillator (Problem 2 b)) illustrated in Fig. 3 (b) is better approximated by an IOUP prior. To motivate these results we argue that the similarity to the OUP samples is a global property of the solution’s structure. However, the filter computes the approximate solution along the time axis ’locally’, proceeding with small time steps. In particular the IOUP filter predicts with high probability the -th derivative smaller at every time step, whereas the derivative of an oscillator is periodically changing and doesn’t decay to zero or converges to a finite number.

(a) ODE solution of Problem 2 a),
(b) Van der Pol oscillator. ,
Figure 3: Oscillators. IOUP solver in red, IWP-solver in green.

4.3 Moderate systems

Problem 3. is a system of ODEs (of order 1 and dimension 10) which describes a radioactive decay chain. The ten solutions of the ODE problem are shown in Fig. 4 : the trajectories decay to zero for (apart from which converges to one). Again, as discussed for ODE 1 , the solution functions look similar to the mean reverting samples of the OUP. In Fig. 5 we plotted two orbits of the ODE problem 3, with a step size of and . While the IWP oscillates around the orbit, the IOUP solvers remains near to it. Moreover the more stiff is the orbit, the more we expect the Ornstein-Uhlenbeck to perform well. Indeed, the plots confirm that this intuition might be useful.

Figure 4: Solution functions to ODE Problem 3, computed with a Runge Kutta method with step size
(a) Orbit with the function on the x-axis and on the y-axis,
(b) Orbit with the function on the x-axis and on the y-axis
Figure 5: Orbits of Problem 3. In red: IOUP-solver, in green: IWP solver. In black the solution (computed with a RK-method with very small step size)

5 Discussion

The experiments presented in Section 4 provide good material to discuss the differences between the IOUP and the IWP solver. An IOUP prior appears to approximate better ’ODEs whith bounded derivatives’, due to the drifting property which keeps the process near to the mean zero with high probability (in our model the -th derivative of the solution). Fig. 2 (b) and Fig. 5 suggest this argument is reasonable: it distinctly shows how the approximate solution with an IWP prior oscillates unstably around the analytical solution due to the fact that it is less conservative than the OUP (in the sense that it tends to deviate away from its mean) whereas the IOUP solver remains closer to it. In this perspective, an IWP works as a better prior for divergent ODEs, like e.g the exponential function (Fig. 2 a)). Our intuition was not validated for oscillators (Fig. 3). This is probably due to the fact that the trajectory of oscillators— although it resembles the drifting property— periodically changes the value of the derivative, whereas the IOUP-solver predicts a smaller derivative at each time step.

6 Summary

In the framework for Bayesian filtering we examined theory of probabilistic ODE solvers which return Gaussian process posterior distributions instead of point estimates and provide uncertainty measures over the solutions. We stressed the Bayesian nature of these solvers and discussed the question of prior selection. Hence we proposed a novel solver which employs an IOUP prior over the solution of ODEs, and provided experiments which show a competitive behaviour of this solver with the already well-established IWP-solver.


7 Appendix

7.1 Matrices and or IOUP

It is easy to see that


Let’s calculate given by [13]



with . We assume . We have





we get


7.2 IOUP local convergence rate for the posterior mean

If we employ a -times integrated OUP over the solution , where , the prediction step for the mean with initial value is where


7.3 Variances of IOUP and IWP

Let denote an Ornstein Uhlenbeck process with and a standard Wiener process. In this section we will write with for simplicity in the calculations. We want to show :

We calculate a) and b):


So we can see that