quantdata.dysanos.grid.gendysanos.arb_tracing#
Orthogonal-state direction and notional tracing for conditional arbitrage.
Arb tracing separates the conditional portfolio into a bounded direction function and an external scalar notional. A direction is learned at a moderate probe notional, after which its notional is traced explicitly. A finite utility optimum identifies a risky trade; a direction whose notional can keep increasing is passed to the empirical no-loss audit.
- class quantdata.dysanos.grid.gendysanos.arb_tracing.ArbTracingConfig(*, label, source_cache_uid, state_features, risk_aversion, utility, trading_times=10, expiries=7, instruments_per_expiry=21, probe_notional=2.0, raw_norm_penalty=1e-05, raw_norm_soft_limit=8.0, covariance_relative_floor=1e-10, group='', user_version='0.1', network_config=FeedForwardConfig(activation='SiLU', num_depth=2, num_width=96, use_bias=True))[source]#
Bases:
objectLogical geometry and objective of one arb-tracing direction.
- network_config: FeedForwardConfig = FeedForwardConfig(activation='SiLU', num_depth=2, num_width=96, use_bias=True)#
- class quantdata.dysanos.grid.gendysanos.arb_tracing.ArbTracingTrainConfig(*, batch_size=4096, valuation_batch_size=16384, epochs=20000, minimum_epochs=4000, value_update=250, checkpoint_update=2000, lr=0.0003, weight_decay=0.0, compile=True, convergence_points=12, convergence_relative_tolerance=0.0001, seed=91301)[source]#
Bases:
objectOperational settings which permit checkpoint warm starts.
- class quantdata.dysanos.grid.gendysanos.arb_tracing.OrthogonalArbDirection(env, *, config, state_mean, state_whitener)[source]#
Bases:
BaseModelIndependent per-time direction networks in whitened state coordinates.
- forward(state)[source]#
Forward method.
- Parameters:
data (dict) – Input data dictionary containing tensors for the model. The expected keys and tensor shapes depend on the specific model implementation.
training (bool, default
False) – Whether the model is in training mode.return_what (
BaseModel.ReturnWhat, defaultReturnWhat.LOSS_WEIGHT) – Specifies what the model should return. Options are: -ReturnWhat.LOSS_WEIGHT: return floatloss(with gradient) and floatweight(without gradient) for training. -ReturnWhat.VALUATION: returnloss,weightand a dictionary of additional float metrics. -ReturnWhat.PATHWISE: return pathwise metrics as dictionary.
- quantdata.dysanos.grid.gendysanos.arb_tracing.fit_physical_state_whitener(state, path_weight, indices, *, relative_eigenvalue_floor=1e-10)[source]#
Fit a time-specific physical-measure orthogonal state basis.
The cached market is sampled under an importance proposal. Consequently the physical state covariance is estimated with
p/qweights, using training paths only. A caller may replace these tensors with analytic Gaussian moments when they are persisted with a future universe cache.
- quantdata.dysanos.grid.gendysanos.arb_tracing.traced_scale_statistics(pnl, band, slope, path_weight, component, *, utility, risk_aversion, loss_probability_epsilon, confidence_z=3.0, loss_mc_multiplier=1.0)[source]#
Measure utility, marginal scale value, losses, and finite-risk quality.
- quantdata.dysanos.grid.gendysanos.arb_tracing.tracing_numerical_band(action, returns, costs, instrument_band, *, roundoff_multiplier=32.0)[source]#
Propagate instrument arithmetic bands through a traced portfolio.
- quantdata.dysanos.grid.gendysanos.arb_tracing.tracing_pnl(action, returns, costs)[source]#
Return exact net P&L for each path and trading time.
- quantdata.dysanos.grid.gendysanos.arb_tracing.tracing_pnl_right_derivative(base_action, direction, notional, returns, costs)[source]#
Return the right derivative of exact net P&L along one direction.
- quantdata.dysanos.grid.gendysanos.arb_tracing.tracing_raw_norm_penalty(raw_l1, *, soft_limit)[source]#
Keep the direction map away from its asymptotically flat radial tail.