Docs / nablatensor-quant / com.nablatensor.quant

final class

TimeGrid

The simulation schedule for one path: how many steps, and what fraction of the total maturity each step spans. Purely numeric — the maturity itself stays a differentiable market input, so a model block scales each step by maturity * grid.fraction(i) and theta still flows.

uniform(int) is n equal steps and reproduces the earlier steps(int) arithmetic exactly. ) takes explicit ascending fixing times (the last is the maturity) and normalises the gaps, so a path can be sampled densely near a barrier and sparsely elsewhere without changing the model.

Methods

static TimeGrid uniform(int n)

n equally spaced steps.

static TimeGrid of(double... times)

Explicit fixing times in ascending order; times[times.length - 1] is the maturity. The returned grid has times.length steps whose fractions are the normalised gaps (t[i] - t[i-1]) / t[last] with t[-1] = 0.

int steps()

Number of steps per path.

double fraction(int i)

Step i's share of the total maturity; sum(fraction(i)) == 1.

double cumulative(int i)

Cumulative share of maturity elapsed by the end of step i.

boolean isUniform()

Whether every step spans the same fraction (an uniform(int) grid, or an equal-gap of).

String toString()