Expand description
Public path generation over the stochastic-process traits — the
library’s sample_paths API (the TF-Quant-Finance idiom): give it a
process, an initial state and a sampling configuration, get back the
simulated paths as a dense matrix, generated in parallel with the
same deterministic draw discipline the pricing engines use.
Two entry points:
sample_paths_1dfor scalar processes (StochasticProcess1D), with the full sampler menu: seeded pseudo-random antithetic pairs, or a low-discrepancy sequence routed through the Brownian bridge;sample_pathsfor N-state / M-factor processes (StochasticProcess); the QMC route runs one bridge per factor.
Paths exclude the initial state (they start at the first step), the
convention every payoff in the library assumes. Draws are per-path
deterministic — path i under seed s is the same regardless of
thread scheduling or how many other paths are requested alongside it.
Structs§
- Factor
Scratch - Per-thread scratch for multi-factor draw generation.
- Multi
Paths - Simulated multi-state paths: path
i, stepjis adim-long state vector atdata[(i * steps + j) * dim ..][..dim]. - Paths
- Simulated scalar paths in dense row-major storage: path
ioccupiesstepsconsecutive values, excluding the initial state. - Sample
Config - Sampling configuration shared by both entry points.
Enums§
- Multi
Draws - Per-path factor draws for multi-state processes, step-major: the
increments of step
joccupydw[j * factors ..][..factors]. Public so streaming multi-asset engines can consume draws without materializing aMultiPathsmatrix. - Path
Draws - Deterministic per-path Brownian increment source. Pseudo-random paths come in antithetic pairs (2k, 2k+1) from independent per-pair streams; low-discrepancy paths are sequence points routed through the Brownian bridge.
- Sampler
- Draw sampler.
Sobolselects the low-discrepancy family: true Sobol (van der Corput) in one dimension, a scrambled multi-dimensional sequence through a Brownian bridge for path-wise simulation.PseudoRandomuses seeded per-path PCG64 streams with antithetic pairing.
Functions§
- sample_
paths - Simulate paths of an N-state process from the state
x0. The stepping scheme is the process’s ownevolve(multi-factor schemes are process-owned — e.g. Heston full-truncation or QE);dwcarries independent increments, any factor correlation lives inside the process. - sample_
paths_ 1d - Simulate paths of a scalar process from
x0under the given discretization scheme.