ctg.brownian_motion#

Brownian motion helper utilities.

This module provides a compact implementation of the Levy–Ciesielski expansion used to sample Brownian paths from a finite set of parameters. The functions are intentionally small and deterministic which makes them useful for tests and reproducibility.

Functions

LC_matrix(L, tt, T)

Generate matrix for sampling Levy-Ciesielski expansion of level L on [0, T] on time nodes tt.

param_LC_W(yy, tt, T)

Compute Levy–Ciesielski expansion samples of Brownian motion.

ctg.brownian_motion.LC_matrix(L, tt, T)[source]#

Generate matrix for sampling Levy-Ciesielski expansion of level L on [0, T] on time nodes tt. :type L: int :param L: Number of levels in the Levy-Ciesieslky expansion. We :type L: int :type tt: ndarray :param tt: 1D array of time points at which to evaluate the basis functions. :type tt: np.ndarray :type T: float :param T: Final time, used to rescale the time points. :type T: float

Returns:

A (dim_y, len(tt)) matrix where each row is a basis function evaluated at the given time points.

Return type:

np.ndarray

Parameters:
  • L (int)

  • tt (ndarray)

  • T (float)

ctg.brownian_motion.param_LC_W(yy, tt, T)[source]#

Compute Levy–Ciesielski expansion samples of Brownian motion.

Parameters:
  • yy – Parameter vector or array used to construct sample paths.

  • tt – 1D array of time points in [0, T] where the paths are evaluated.

  • T – Final time for the expansion (used for rescaling).

Returns:

2D numpy array where each row is a sampled Brownian path evaluated at the times in tt.