Buffers


Buffers are simply structs gathering containers that are used for in-place computations. They inherit from

and don't require any special methods, except for functions b! and σ! (or for linear diffusions B! and β! in place of b!) having to specify explicitly how the drift and volatility are supposed to be saved inside the buffers. We provide implementation of standard buffers that should be sufficient for many problems:

DiffusionDefinition.StandardEulerBufferType
struct StandardEulerBuffer{Tb,Tσ,Tdw} <: AbstractBuffer
    b::Tb
    y::Tb
    σ::Tσ
    dW::Tdw
end

Standard buffer for the Euler-Maruyama simulations. The intermediary data is stored in b, σ, y and dW.

source
DiffusionDefinition.LinearDiffBufferType
struct LinearDiffBuffer{Tb,Tσ,Tdw,TB} <: AbstractBuffer
    b::Tb
    y::Tb
    σ::Tσ
    dW::Tdw
    B::TB
end

A buffer for Euler-Maruyama simulations of linear diffusions. Almost the same as StandardEulerBuffer, but contains additional space for an intermediate construction of a matrix B.

source
Tip

If you call in-place methods multiple times, then make sure to pre-define a buffer and then pass it explicitly to solve!.