ou_moments
ou_moments(B, D, m0, S0, t)
Exact mean and covariance of an Ornstein-Uhlenbeck process at time t.
For dx = -B x dt + sqrt(2 D) dW and x_0 ~ N(m0, S0):
m_t = exp(-B t) m0 and
Sigma_t = exp(-B t) (S0 - S_inf) exp(-B t)^T + S_inf, with the stationary
covariance solving B S_inf + S_inf B^T = 2 D.
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.
-
t(float) –Time.
Returns:
-
mean(ndarray of shape (ndim,)) –Mean at time
t. -
cov(ndarray of shape (ndim, ndim)) –Covariance at time
t.