quantdata.dysanos.grid.gendysanos.terminal_universe#

Terminal-payoff sampling from decoded SANOS surfaces.

SANOS represents a normalized terminal spot distribution as a discrete mixture. With smoothing, every mixture atom is replaced by a driftless lognormal component. Sampling that same mixture makes the Monte Carlo call payoff consistent with the price returned by SanosPricer.

class quantdata.dysanos.grid.gendysanos.terminal_universe.TerminalSamplingDiagnostics(*, minimum_raw_weight, maximum_mass_error, clipped_negative_weight_count)[source]#

Bases: object

Numerical corrections applied to SANOS probability weights.

class quantdata.dysanos.grid.gendysanos.terminal_universe.TerminalPathDiagnostics(*, mode, option_return_horizon, trading_times, trading_step_stride, simulated_state_steps, expiry_step_offsets, dt, maximum_expiry_time_error, minimum_log_spot, maximum_log_spot, importance_sampling=None)[source]#

Bases: object

Geometry and numerical range of a coherent simulated state path.

importance_sampling: dict[str, Any] | None = None#
quantdata.dysanos.grid.gendysanos.terminal_universe.sample_sanos_terminal_ratios(*, component_spots, component_weights, sqrt_variances, smoothness, rng, negative_weight_tolerance=1e-06)[source]#

Draw one normalized terminal spot per path and expiry.

For component spot x and smoothed standard deviation v, the draw is x * exp(-v**2/2 + v*Z). Its conditional mean is x and its call expectation is exactly the Black–Scholes component used by SANOS.

quantdata.dysanos.grid.gendysanos.terminal_universe.build_one_time_terminal_universe(*, xstate, expiries, normalized_strikes, normalized_calls, component_spots, component_weights, sqrt_variances, smoothness, rng)[source]#

Construct one-trade-time option returns from SANOS terminal payoffs.

Calls are entered at the decoded cash price and held to their actual expiry. All strikes for one path/expiry share the same terminal spot. The first-expiry terminal spot also supplies the single spot return.

quantdata.dysanos.grid.gendysanos.terminal_universe.expiry_step_offsets(expiries, *, dt)[source]#

Map year-fraction expiries to an increasing daily path grid.

quantdata.dysanos.grid.gendysanos.terminal_universe.build_terminal_path_universe(*, xstate_path, trading_times, trading_step_stride=1, expiries, expiry_offsets, normalized_strikes, normalized_calls, normalized_deltas, normalized_calls_tp1=None, option_return_step_offset=1, require_bounded_deltas=True)[source]#

Build expiry or repriced option P&Ls from one common state path.

Contract (t, j, k) is entered at daily-path index t * trading_step_stride. With no normalized_calls_tp1, its payoff uses the same sample’s spot at the contract expiry. When endpoint calls are supplied, they must be prices at t + option_return_step_offset of the original cash strike and remaining maturity. An option expiring on or before that endpoint is instead settled at its exact daily expiry and its cash payoff is carried to the return endpoint. The option’s stock hedge is closed at the same exact expiry; otherwise it is closed at the common return endpoint. normalized_deltas are the initial cash-call deltas. SANOS deltas are bounded by default. Direct surface decoders may set require_bounded_deltas=False so smile-induced violations remain visible rather than being rejected or clipped.