SDE Problems
Mathematical Specification of a SDE Problem
To define an SDE Problem, you simply need to give the forcing function f
, the noise function g
, and the initial condition u₀
which define an SDE:
f
and g
should be specified as f(u,p,t)
and g(u,p,t)
respectively, and u₀
should be an AbstractArray whose geometry matches the desired geometry of u
. Note that we are not limited to numbers or vectors for u₀
; one is allowed to provide u₀
as arbitrary matrices / higher dimension tensors as well. A vector of g
s can also be defined to determine an SDE of higher Ito dimension.
Problem Type
Wraps the data which defines an SDE problem
with initial condition u0
.
Constructors
SDEProblem(f::SDEFunction,g,u0,tspan,p=NullParameters();noise=WHITE_NOISE,noise_rate_prototype=nothing)
SDEProblem{isinplace}(f,g,u0,tspan,p=NullParameters();noise=WHITE_NOISE,noise_rate_prototype=nothing)
: Defines the SDE with the specified functions. The default noise isWHITE_NOISE
.isinplace
optionally sets whether the function is inplace or not. This is determined automatically, but not inferred.
Parameters are optional, and if not given then a NullParameters()
singleton will be used which will throw nice errors if you try to index non-existent parameters. Any extra keyword arguments are passed on to the solvers. For example, if you set a callback
in the problem, then that callback
will be added in every solve call.
For specifying Jacobians and mass matrices, see the DiffEqFunctions page.
Fields
f
: The drift function in the SDE.g
: The noise function in the SDE.u0
: The initial condition.tspan
: The timespan for the problem.p
: The optional parameters for the problem. Defaults toNullParameters
.noise
: The noise process applied to the noise upon generation. Defaults to Gaussian white noise. For information on defining different noise processes, see the noise process documentation pagenoise_rate_prototype
: A prototype type instance for the noise rates, that is the outputg
. It can be any type which overloadsA_mul_B!
with itself being the middle argument. Commonly, this is a matrix or sparse matrix. If this is not given, it defaults tonothing
, which means the problem should be interpreted as having diagonal noise.kwargs
: The keyword arguments passed onto the solves.
Example Problems
Examples problems can be found in DiffEqProblemLibrary.jl.
To use a sample problem, such as prob_sde_linear
, you can do something like:
#] add DiffEqProblemLibrary
using DiffEqProblemLibrary.SDEProblemLibrary
# load problems
SDEProblemLibrary.importsdeproblems()
prob = SDEProblemLibrary.prob_sde_linear
sol = solve(prob)
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_linear
— Constantwhere $α=1.01$, $β=0.87$, and initial condtion $u_0=1/2$, with solution
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_2Dlinear
— Constant8 linear SDEs (as a 4x2 matrix):
where $α=1.01$, $β=0.87$, and initial condtion $u_0=\frac{1}{2}$ with solution
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_wave
— Constantand initial condition $u_0=1$ with solution
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_lorenz
— ConstantLorenz Attractor with additive noise
with $σ=10$, $ρ=28$, $β=8/3$, $α=3.0$ and inital condition $u_0=[1;1;1]$.
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_cubic
— Constantand initial condtion $u_0=\frac{1}{2}$, with solution
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_additive
— ConstantAdditive noise problem
and initial condition $u_0=1$ with $α=0.1$ and $β=0.05$, with solution
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_additivesystem
— ConstantA multiple dimension extension of additiveSDEExample
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_nltest
— ConstantRunge–Kutta methods for numerical solution of stochastic differential equations Tocino and Ardanuy
DiffEqProblemLibrary.SDEProblemLibrary.oval2ModelExample
— Functionoval2ModelExample(;largeFluctuations=false,useBigs=false,noiseLevel=1)
A function which generates the Oval2 Epithelial-Mesenchymal Transition model from:
Rackauckas, C., & Nie, Q. (2017). Adaptive methods for stochastic differential equations via natural embeddings and rejection sampling with memory. Discrete and continuous dynamical systems. Series B, 22(7), 2731.
19 SDEs which are only stiff during transitions between biological states.
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_stiffquadstrat
— ConstantThe composite Euler method for stiff stochastic differential equations
Kevin Burrage, Tianhai Tian
And
S-ROCK: CHEBYSHEV METHODS FOR STIFF STOCHASTIC DIFFERENTIAL EQUATIONS
ASSYR ABDULLE AND STEPHANE CIRILLI
Stiffness of Euler is determined by α+β²<1 Higher α or β is stiff, with α being deterministic stiffness and β being noise stiffness (and grows by square).
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_stiffquadito
— ConstantThe composite Euler method for stiff stochastic differential equations
Kevin Burrage, Tianhai Tian
And
S-ROCK: CHEBYSHEV METHODS FOR STIFF STOCHASTIC DIFFERENTIAL EQUATIONS
ASSYR ABDULLE AND STEPHANE CIRILLI
Stiffness of Euler is determined by α+β²<1 Higher α or β is stiff, with α being deterministic stiffness and β being noise stiffness (and grows by square).
DiffEqProblemLibrary.SDEProblemLibrary.generate_stiff_stoch_heat
— FunctionStochastic Heat Equation with scalar multiplicative noise
S-ROCK: CHEBYSHEV METHODS FOR STIFF STOCHASTIC DIFFERENTIAL EQUATIONS
ASSYR ABDULLE AND STEPHANE CIRILLI
Raising D or k increases stiffness
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_bistable
— ConstantBistable chemical reaction network with a semi-stable lower state.
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_bruss
— ConstantStochastic Brusselator
DiffEqProblemLibrary.SDEProblemLibrary.prob_sde_oscilreact
— ConstantAn oscillatory chemical reaction system