Skip to content

sample_ornstein_uhlenbeck

sample_ornstein_uhlenbeck(B, D, m0, S0, times, nsamples, rng)

Sample independent snapshots of an Ornstein-Uhlenbeck process, exactly.

Each snapshot is drawn from the exact Gaussian law at its time (:func:ou_moments), independently of the others, in the order of times.

Parameters:

  • B (ndarray of shape (ndim, ndim)) –

    Drift and diffusion matrices.

  • D (ndarray of shape (ndim, ndim)) –

    Drift and diffusion matrices.

  • m0 (ndarray of shape (ndim,)) –

    Initial mean.

  • S0 (ndarray of shape (ndim, ndim)) –

    Initial covariance.

  • times (array-like of shape (K,)) –

    Snapshot times.

  • nsamples (int) –

    Number of cells per snapshot.

  • rng (Generator) –

    Random generator.

Returns:

  • samples ( list of length K ) –

    samples[k] is an ndarray of shape (nsamples, ndim).

  • times ( ndarray of shape (K,) ) –

    Snapshot times.