quantdata.dysanos.grid.gendysanos.torch_prep#

Prepare terminal-payoff universes from the trained SANOS decoder.

class quantdata.dysanos.grid.gendysanos.torch_prep.DysanosMatchedUniverseBlock(*, start, stop, expiry, incremental)[source]#

Bases: object

Expiry and incremental DYSANOS markets from one simulated path block.

class quantdata.dysanos.grid.gendysanos.torch_prep.DysanosUniverseStreamDiagnostics(minimum_log_spot=inf, maximum_log_spot=-inf, importance_accumulator=None, importance_component_counts=None, minimum_log_weight=inf, maximum_log_weight=-inf, incremental_call_roundoff_clip_count=0, minimum_unclipped_incremental_call=inf)[source]#

Bases: object

Online sampling diagnostics for a matched DYSANOS path stream.

minimum_log_spot: float = inf#
maximum_log_spot: float = -inf#
importance_accumulator: dict[str, ndarray | float] | None = None#
importance_component_counts: ndarray | None = None#
minimum_log_weight: float = inf#
maximum_log_weight: float = -inf#
incremental_call_roundoff_clip_count: int = 0#
minimum_unclipped_incremental_call: float = inf#
class quantdata.dysanos.grid.gendysanos.torch_prep.GenDysanosExperiment(*, generator='dysanos', num_samples=100000, grid_strikes=100, num_nms=20, num_alpha=None, use_matrix_exp=True, bandwidth=1.0, trading_frequency='daily', return_horizon='expiry', mode=None, option_return_horizon=None, num_steps=None, delta_hedged=True, cost_rate=0.0001, num_trading_times=10, dt=0.003968253968253968, seed=500000, block_size=25000, importance_sampling=None)[source]#

Bases: object

Logical inputs for one coherent generated DYSANOS market case.

generator: str = 'dysanos'#
num_samples: int = 100000#
grid_strikes: int = 100#
num_nms: int = 20#
num_alpha: int | None = None#
use_matrix_exp: bool = True#
bandwidth: float = 1.0#
trading_frequency: str = 'daily'#
return_horizon: str = 'expiry'#
mode: str | None = None#
option_return_horizon: str | None = None#
num_steps: int | None = None#
delta_hedged: bool = True#
cost_rate: float = 0.0001#
num_trading_times: int = 10#
dt: float = 0.003968253968253968#
seed: int = 500000#
block_size: int = 25000#
importance_sampling: GaussianSpotImportanceConfig | None = None#
property trading_times: int#

Number of return start times represented in the universe.

property trading_step_stride: int#

Spacing of consecutive action dates on the daily state path.

property reference_paths: int#

Paths used to fit diagnostic estimators (80% of the universe).

property audit_paths: int#

Held-out paths used only to audit fitted diagnostics.

quantdata.dysanos.grid.gendysanos.torch_prep.finalize_dysanos_stream_diagnostics(diagnostics)[source]#

Return matched path diagnostics after fully consuming the stream.

quantdata.dysanos.grid.gendysanos.torch_prep.iter_dysanos_matched_universe_blocks(experiment, *, diagnostics, verbose=<cdxcore.verbose.Context object>)[source]#

Yield both required return horizons from one coherent DYSANOS path.

quantdata.dysanos.grid.gendysanos.torch_prep.prepare_one_time_terminal_experiment(experiment, *, verbose=<cdxcore.verbose.Context object>)[source]#

Compatibility entry point for coherent one-step path generation.

quantdata.dysanos.grid.gendysanos.torch_prep.prepare_terminal_path_experiment(experiment, *, verbose=<cdxcore.verbose.Context object>)[source]#

Generate terminal payoffs from one extended state path per sample.