# IBM¶

class probnum.diffeq.IBM(ordint, spatialdim, diffconst, precond_step=1.0)[source]

Bases: probnum.diffeq.odefiltsmooth.prior.ODEPrior

Integrated Brownian motion of order $$q$$ prior.

The integrated Brownian motion prior is represented through the LTI SDE

$dX(t) = F X(t) dt + L dB(t)$

where for readibility reasons we did not write the preconditioner matrix $$P$$; see ODEPrior for explanations.

• It has driftmatrix $$F$$ given by

$\begin{split}F = I_d \otimes \tilde F, \quad \tilde F = \begin{pmatrix} 0 & I_q \\ 0 & 0 \end{pmatrix}\end{split}$

where the top left zero-vector has $$q$$ rows and 1 column.

• It has dispersion matrix $$L$$ given by

$L = I_d \otimes \tilde L, \quad \tilde L = \sigma \, e_{q+1}$

where $$\sigma$$ is the diffusion constant, that is, $$\sigma^2$$ is the intensity of each dimension of the $$d$$-dimensional Brownian motion driving the SDE and $$e_{q+1}=(0, ..., 0, 1)$$ is the $$(q+1)$$-st unit vector.

• The Brownian motion $$B=B(t)$$ driving the SDE has unit diffusion $$Q = I_d$$.

Parameters: ordint (int) – Order of integration $$q$$. The higher $$q$$, the higher the order of the ODE filter. spatialdim (int) – Spatial dimension $$d$$ of the ordinary differential equation that is to be modelled. diffconst (float) – Diffusion constant $$sigma$$ of the stochastic process. precond_step (float, optional) – Expected step size $$h$$ used in the ODE filter. This quantity is used for preconditioning, see ODEPrior for a clear explanation. Default is $$h=1$$.

Attributes Summary

 diffusionmatrix Evaluates Q. dispersionmatrix driftmatrix force inverse_preconditioner Convenience property to return the readily-computed inverse preconditioner without having to remember abbreviations. ndim Spatial dimension (utility attribute). preconditioner Convenience property to return the readily-computed preconditioner without having to remember abbreviations.

Methods Summary

 chapmankolmogorov(start, stop, step, …) Closed form solution to the Chapman-Kolmogorov equations for the integrated Brownian motion. dispersion(time, state, **kwargs) Evaluates l(t, x(t)) = L(t). drift(time, state, **kwargs) Evaluates f(t, x(t)) = F(t) x(t) + u(t). jacobian(time, state, **kwargs) maps t -> F(t) precond2nordsieck(step) Computes preconditioner inspired by Nordsieck. proj2coord(coord) Projection matrix to $$i$$-th coordinates. sample(start, stop, step, initstate, **kwargs) Samples from initstate at start to stop with stepsize step.

Attributes Documentation

diffusionmatrix

Evaluates Q.

dispersionmatrix
driftmatrix
force
inverse_preconditioner

Convenience property to return the readily-computed inverse preconditioner without having to remember abbreviations.

Returns: Inverse preconditioner matrix $$P^{-1}$$ np.ndarray, shape=(d(q+1), d(q+1))
ndim

Spatial dimension (utility attribute).

preconditioner

Convenience property to return the readily-computed preconditioner without having to remember abbreviations.

Returns: Preconditioner matrix $$P$$ np.ndarray, shape=(d(q+1), d(q+1))

Methods Documentation

chapmankolmogorov(start, stop, step, randvar, *args, **kwargs)[source]

Closed form solution to the Chapman-Kolmogorov equations for the integrated Brownian motion.

It is given by

$X_{t+h} \, | \, X_t \sim \mathcal{N}(A(h)X_t, Q(h))$

with matrices $$A(h)$$ and Q(h) defined by

$[A(h)]_{ij} = \mathbb{I}_{i\leq j} \frac{h^{j-i}}{(j-i)!}$
$[Q(h)]_{ij} = \sigma^2 \frac{h^{2q+1-i-j}}{(2q+1-i-j)!(q-j)!(q-i)!}$

The implementation that is used here is more stable than the matrix-exponential implementation in super().chapmankolmogorov() which is relevant for combinations of large order $$q$$ and small steps $$h$$. In these cases even the preconditioning is subject to numerical instability if the transition matrices $$A(h)$$ and $$Q(h)$$ are computed with matrix exponentials.

“step” variable is obsolent here and is ignored.

dispersion(time, state, **kwargs)

Evaluates l(t, x(t)) = L(t).

drift(time, state, **kwargs)

Evaluates f(t, x(t)) = F(t) x(t) + u(t).

jacobian(time, state, **kwargs)

maps t -> F(t)

precond2nordsieck(step)

Computes preconditioner inspired by Nordsieck.

Computes the matrix $$P$$ given by

$P = I_d \otimes diag (1, h, h^2, ..., h^q)$

as well as its inverse $$P^{-1}$$.

Parameters: step (float) – Step size $$h$$ used for preconditioning. If $$h$$ is so small that $$h^q! < 10^{-15}$$, it is being set to $$h = (\cdot 10^{-15})^{1/q}$$. precond (np.ndarray, shape=(d(q+1), d(q+1))) – Preconditioner matrix $$P$$. invprecond (np.ndarray, shape=(d(q+1), d(q+1))) – Inverse preconditioner matrix $$P^{-1}$$.
proj2coord(coord)

Projection matrix to $$i$$-th coordinates.

Computes the matrix

$H_i = \left[ I_d \otimes e_i \right] P^{-1},$

where $$e_i$$ is the $$i$$-th unit vector, that projects to the $$i$$-th coordinate of a vector. If the ODE is multidimensional, it projects to each of the $$i$$-th coordinates of each ODE dimension.

Parameters: coord (int) – Coordinate index $$i$$ which to project to. Expected to be in range $$0 \leq i \leq q + 1$$. Projection matrix $$H_i$$. np.ndarray, shape=(d, d*(q+1))
sample(start, stop, step, initstate, **kwargs)

Samples from initstate at start to stop with stepsize step.

Start, stop and step lead to a np.arange-like interface. Returns a single element at the end of the time, not the entire array!