svStochasticIntegratorW2Ito

struct W2ItoCoefficients
#include <svStochasticIntegratorW2Ito.h>

Extended Butcher tableau for the Tang & Xiao weak-order-2 SRK family.

The coefficients characterise a specific member of the general weak-order-2 stochastic Runge-Kutta scheme for Ito SDEs. The number of stages \(s\) is inferred from the length of alpha. The tableau is

\[\begin{split} \begin{array}{c|c|c} & A^{(0)} & B^{(0)} \\ \hline & A^{(1)} & B^{(1)}\; B^{(2)} \\ \hline & \alpha & \beta^{(0)}\; \beta^{(1)} \end{array} \end{split}\]

with \(A^{(0)}, A^{(1)}, B^{(0)}, B^{(1)}, B^{(2)}\) strictly lower-triangular \(s\times s\) matrices (explicit method) and \(\alpha, \beta^{(0)}, \beta^{(1)}\) length- \(s\) weight vectors.

Public Functions

inline size_t numStages() const

Number of stages, inferred from the length of alpha.

inline double c0(size_t i) const

Drift stage node \(c^{(0)}_i = \sum_j A^{(0)}_{ij}\) (row sum of A0).

inline double c1(size_t i) const

Diffusion stage node \(c^{(1)}_i = \sum_j A^{(1)}_{ij}\) (row sum of A1).

Public Members

std::vector<double> alpha

drift weights, length s

std::vector<double> beta0

diffusion weights on the three-point increment, length s

std::vector<double> beta1

diffusion weights on the diagonal iterated integral, length s

std::vector<std::vector<double>> A0

drift-to-drift stage matrix, s x s

std::vector<std::vector<double>> B0

diffusion-to-drift stage matrix, s x s

std::vector<std::vector<double>> A1

drift-to-diffusion stage matrix, s x s

std::vector<std::vector<double>> B1

self-noise diffusion-to-diffusion stage matrix, s x s

std::vector<std::vector<double>> B2

cross-noise diffusion-to-diffusion stage matrix, s x s

class svStochasticIntegratorW2Ito : public StochasticRKIntegratorBase
#include <svStochasticIntegratorW2Ito.h>

The svStochasticIntegratorW2Ito class implements the Tang & Xiao efficient weak second-order (deterministic order 3+) Runge-Kutta family for Ito SDEs.

Tang, X., Xiao, A. "Efficient weak second-order stochastic Runge-Kutta methods
for Ito stochastic differential equations", BIT Numer. Math. 57, 241-260 (2017).
https://doi.org/10.1007/s10543-016-0618-9

This is the shared base for the concrete W2Ito1 and W2Ito2 methods, which differ only in their coefficient tableau (see svStochasticIntegratorW2Ito1 and svStochasticIntegratorW2Ito2). It shares the pluggable noise-generator architecture of the other native stochastic integrators, so the same prescribed-noise test harness drives every method unchanged.

For an \(s\)-stage tableau the step (paper eq. 3.1) is

\[ y_{n+1} = y_n + \sum_i \alpha_i f(H^{(0)}_i)\,h + \sum_i \sum_k \beta^{(0)}_i g_k(H^{(k)}_i)\,\hat I_k + \sum_i \sum_k \beta^{(1)}_i g_k(H^{(k)}_i)\,\hat I_{(k,k)} \]

with drift stages \(H^{(0)}_i\) and per-noise-source diffusion stages \(H^{(k)}_i\). The driving random variables are a three-point increment \(\hat I_k \in \{\pm\sqrt{3h}, 0\}\) (from the Gaussian \(\Delta W_k\)), a two-point scale \(\xi = \eta_1\sqrt h\) (from the Gaussian \(\Delta Z_0\)), and the mixed iterated integrals \(\hat I_{(k,l)} = \tfrac12(\hat I_l \mp \eta_2 \hat I_l)\) for \(k\neq l\) (using a second two-point sign \(\eta_2\) from \(\Delta Z_1\)) and \(\hat I_{(k,k)} = \tfrac12(\hat I_k^2/\xi - \xi)\) on the diagonal. The step is explicit and derivative-free.

Warning

Stochastic integration is in beta.

Subclassed by svStochasticIntegratorW2Ito1, svStochasticIntegratorW2Ito2

Protected Functions

void integrateImpl(double currentTime, double timeStep) override

Performs the integration of the associated dynamic objects up to time currentTime+timeStep

svStochasticIntegratorW2Ito(DynamicObject *dyn, const W2ItoCoefficients &coefficients)

Constructor used by the concrete W2Ito methods, which supply their tableau.

inline void bindStochasticMethodStorage() override

Allocate the scratch required by this numerical method.

void bindMethodStorage()

Size method buffers from the bound state and noise dimensions once.

void gatherDerivativeStage(size_t stageIndex)

Copy live drift values into the selected stage column.

Parameters:

stageIndex – Zero-based stage column to read or write.

void gatherAllDiffusionStages(size_t stageIndex)

Capture every independent noise source in the selected stage column.

Parameters:

stageIndex – Zero-based stage column to read or write.

void gatherDiffusionStage(size_t globalNoiseIndex, size_t stageIndex)

Capture the selected noise source in its packed rows of a stage column.

Parameters:
  • globalNoiseIndex – Independent noise-source index in the bound topology.

  • stageIndex – Zero-based stage column to read or write.

void combineDrifts(const std::vector<double> &factors, size_t length)

Combine the requested leading drift stages into combinedDerivative.

Parameters:
  • factors – Stage multipliers in evaluation order.

  • length – Number of leading stages to combine.

void combineDiffusion(size_t globalNoiseIndex, const std::vector<double> &factors, size_t length)

Combine leading stages for one source into combinedDiffusion.

Parameters:
  • globalNoiseIndex – Independent noise-source index in the bound topology.

  • factors – Stage multipliers in evaluation order.

  • length – Number of leading stages to combine.

Protected Attributes

const W2ItoCoefficients coefficients

The extended Butcher tableau of the specific W2Ito method.

Eigen::VectorXd combinedDerivative

Weighted drift combination used to build a candidate.

Eigen::VectorXd scaledDerivative

Scratch for a scaled drift contribution.

Eigen::VectorXd combinedDiffusion

Weighted diffusion contributions in packed noise-source order.

Eigen::VectorXd scaledDiffusion

Scratch for a scaled diffusion contribution.

Eigen::MatrixXd derivativeStages

Drift scalars by stage; each stage occupies one contiguous column.

Eigen::MatrixXd diffusionStages

Packed diffusion scalars by stage, grouped by independent source.

Eigen::VectorXd weakDW

Discrete weak-method increments indexed by independent source.

Eigen::VectorXd diagonalIntegral

Diagonal iterated-integral terms indexed by independent source.

Eigen::VectorXd pseudoSteps

Temporary per-source noise weights for candidate construction.