quantdata.dysanos.grid.gendysanos.historical_state_period_audit#
One-day portfolio audit from fitted historical DYSANOS states.
At each historical observation, this module resets spot to one, simulates independent one-day continuations from the fitted DYSANOS state, and solves a maximum-mean portfolio problem. The frozen portfolio is then marked from the current observed market surface to the next observed market surface. The next observation is used only after the portfolio has been fitted.
- class quantdata.dysanos.grid.gendysanos.historical_state_period_audit.HistoricalStateAuditConfig(*, training_paths=1024, validation_paths=4096, cost_rate=0.0, seed=731991, decoder_block_size=8192)[source]#
Bases:
objectNumerical settings for the historical-state one-day audit.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.aggregate_historical_audits(rows)[source]#
Aggregate historical-state optimization and execution outcomes.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.audit_historical_state(model, sampler, market, *, index, fit_error, config)[source]#
Fit and execute one historical state’s one-day portfolio.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.conditional_period_returns(model, sampler, *, surface_state, expiries, paths, seed, decoder_block_size)[source]#
Draw model-consistent one-day spot and fixed-call returns.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.decode_historical_fit(model, sampler, market)[source]#
Decode every historical state at the original 100-strike market grid.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.execute_frozen_action(action, *, spot_ratio, entry_calls, exit_calls, cost_rate)[source]#
Execute one spot-plus-options action on an observed one-day move.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.observed_surface_calls(*, grid_expiries, extended_strikes, inner_calls, query_expiries, query_strikes)[source]#
Mark normalized calls on one observed surface.
Strike interpolation uses the observed normalized call prices and their SANOS boundary values. Maturity interpolation is linear in normalized call price. Between time zero and the first grid expiry it interpolates from intrinsic value. The experiment queries only maturities no later than the last grid expiry.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.solve_optimal_expected_return(scenario_return, costs)[source]#
Solve the expected-P&L problem under a global unit L1 budget.
For mean return
muand symmetric linear costsc, the problem ismax_a mu @ a - c @ abs(a)subject tosum(abs(a)) <= 1.Its exact solution puts the entire budget into the signed coordinate with the largest positive score
abs(mu_j) - c_j. If every score is non-positive, the zero action is optimal.
- quantdata.dysanos.grid.gendysanos.historical_state_period_audit.solve_mean_variance_portfolio(scenario_return, *, risk_aversion, radius=1.0, maximum_iterations=5000, tolerance=2e-07)[source]#
Solve a conditional mean-variance portfolio on an L1 ball.
The maximized training objective is
mu @ a - 0.5 * risk_aversion * a @ covariance @ a.Accelerated projected gradient uses the exact Euclidean projection onto the L1 ball. The returned projected-gradient residual provides a direct first-order convergence diagnostic.