markovflow.sde
Package containing SDE classes and related functions.
markovflow.sde.drift
markovflow.sde.sde_utils
SDE
Bases: abc.ABC
abc.ABC
Abstract class representing Stochastic Differential Equation.
&dx(t)/dt = f(x(t),t) + l(x(t),t) w(t)
state_dim – The output dimension of the kernel.
state_dim
Return the state dimension of the sde.
drift
Drift function of the SDE i.e. f(x(t),t)
f(x(t),t)
x – state at t i.e. x(t) with shape (n_batch, state_dim).
t
x(t)
(n_batch, state_dim)
t – time t with shape (n_batch, state_dim).
Drift value i.e. f(x(t), t) with shape (n_batch, state_dim).
f(x(t), t)
NotImplementedError – Must be implemented in derived classes.
diffusion
Diffusion function of the SDE i.e. l(x(t),t)
l(x(t),t)
t – time t with shape (n_batch, 1).
(n_batch, 1)
Diffusion value i.e. l(x(t), t) with shape (n_batch, state_dim, state_dim).
l(x(t), t)
(n_batch, state_dim, state_dim)
gradient_drift
Calculates the gradient of the drift wrt the states x(t).
..math:: df(x(t))/dx(t)
x – states with shape (num_states, state_dim).
t – time of states with shape (num_states, 1), defaults to zero.
the gradient of the SDE drift with shape (num_states, state_dim).
expected_drift
Calculates the Expectation of the drift under the provided Gaussian over states.
..math:: E_q(x(t))[f(x(t))]
q_mean – mean of Gaussian over states with shape (n_batch, num_states, state_dim).
q_covar – covariance of Gaussian over states with shape (n_batch, num_states, state_dim, state_dim).
the expectation value with shape (n_batch, num_states, state_dim).
expected_gradient_drift
Calculates the Expectation of the gradient of the drift under the provided Gaussian over states
..math:: E_q(.)[f’(x(t))]
OrnsteinUhlenbeckSDE
Bases: SDE
Ornstein-Uhlenbeck SDE represented by
..math:: dx(t) = -λ x(t) dt + dB(t), the spectral density of the Brownian motion is specified by q.
Initialize the Ornstein-Uhlenbeck SDE.
decay – λ, a tensor with shape (1, 1).
(1, 1)
q – spectral density of the Brownian motion (state_dim, state_dim).
(state_dim, state_dim)
Drift of the Ornstein-Uhlenbeck process ..math:: f(x(t), t) = -λ x(t)
Diffusion of the Ornstein-Uhlenbeck process ..math:: l(x(t), t) = sqrt(q)
DoubleWellSDE
Double-Well SDE represented by
..math:: dx(t) = f(x(t)) dt + dB(t),
where f(x(t)) = 4 x(t) (1 - x(t)^2) and the spectral density of the Brownian motion is specified by q.
Initialize the Double-Well SDE.
Drift of the double-well process ..math:: f(x(t), t) = 4 x(t) (1 - x(t)^2)
Diffusion of the double-well process ..math:: l(x(t), t) = sqrt(q)