nx_fin_advstats.nx
buildroot/runtime/nx_fin_advstats.nx
about
nx_fin_advstats.nx -- advanced backtest statistics (the Lopez de Prado rigor that separates a real edge from
the luckiest of many tries). Core = the DEFLATED SHARPE RATIO: the multiple-testing correction. When you test
T strategies (our tournament does), the BEST Sharpe is inflated by selection; the deflated Sharpe subtracts the
expected-max-under-null haircut (trial_std * sqrt(2*ln T)) before testing significance. Composes me_isqrt
(nx_fin_metrics). i64 fixed-point (Sharpe in MILLI = SR*1000); sqrt(2 ln T) via a data table (avoids integer
ln). This moves us from BEHIND to PARITY on advanced stats (PBO / CPCV are the next refinements).
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_fin_metrics.nx
imported by: nx_fin_advstats_gate.nx
structs
| none |
consts
| 10 | const K_MAGIC_1177: i64 = 1177 |
| 11 | const K_MAGIC_1665: i64 = 1665 |
| 12 | const K_MAGIC_2036: i64 = 2036 |
| 13 | const K_MAGIC_2354: i64 = 2354 |
| 14 | const K_MAGIC_2634: i64 = 2634 |
| 15 | const K_MAGIC_3035: i64 = 3035 |
| 16 | const K_MAGIC_3723: i64 = 3723 |
functions
| 19 | func as_sharpe_tstat_milli(sr_milli: i64, n: i64) -> i64 |
| 26 | func as_max_z_milli(n_trials: i64) -> i64 |
| 38 | func as_deflated_sr_milli(best_sr_milli: i64, trial_std_milli: i64, n_trials: i64) -> i64 |
| 45 | func as_deflated_significant(best_sr_milli: i64, trial_std_milli: i64, n_trials: i64, n: i64, thresh_milli: i64) -> i64 |