Skip to content
TotalFinance

Risk · @insiderfinance/totalfinance

@insiderfinance/totalfinance/risk/research

import { … } from '@insiderfinance/totalfinance/risk/research'
stable-by-law (pre-1.0; not a 1.0 stability guarantee)iface 14type 2fn 10JSON ↗

Functions · 10

Interfaces · 14

Types · 2

iface

BacktestOverfittingProbabilityOptions

#

Options for probabilityOfBacktestOverfitting.

Signature
import type { BacktestOverfittingProbabilityOptions } from '@insiderfinance/totalfinance/risk/research';

// ───────────────────────── PBO (combinatorially-symmetric cross-validation) ─────────────────────────
/** Options for {@link probabilityOfBacktestOverfitting}. */
export interface BacktestOverfittingProbabilityOptions {
    /**
     * Number of disjoint contiguous row-blocks `S` (even, `4 ≤ S ≤ 16`). Default `16` (Bailey & López de
     * Prado). The `C(S, S/2)` train/test splits grow fast in `S`; the observation count is trimmed to a
     * multiple of `S` (the oldest rows dropped).
     */
    splits?: number;
}
Fields, parameters and returned members (1)
Name · typeMeaning · unitRequired · default
splitsnumber

Number of disjoint contiguous row-blocks S (even, 4 ≤ S ≤ 16). Default 16 (Bailey & López de Prado). The C(S, S/2) train/test splits grow fast in S; the observation count is trimmed to a multiple of S (the oldest rows dropped).

unitless by name
OptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

BacktestOverfittingProbabilityResult

#

The result of a CSCV probability-of-backtest-overfitting analysis.

Signature
import type { BacktestOverfittingProbabilityResult } from '@insiderfinance/totalfinance/risk/research';

/** The result of a CSCV probability-of-backtest-overfitting analysis. */
export interface BacktestOverfittingProbabilityResult {
    /**
     * Probability of backtest overfitting: the fraction of the `C(S, S/2)` symmetric train/test splits on
     * which the in-sample-best configuration ranks **below the out-of-sample median** (logit `λ < 0`). Near
     * `0.5` for noise (selection is worthless out of sample), near `0` for a genuinely persistent edge.
     */
    backtestOverfittingProbability: number;
    /** Number of symmetric train/test splits evaluated: `C(S, S/2)`. */
    combinations: number;
    /** Blocks `S` actually used. */
    splits: number;
    /** Observations (rows) used after trimming to a multiple of `S`. */
    observations: number;
    /** Number of strategy configurations (columns) `N`. */
    trials: number;
    /** Median logit `λ = ln(r̄/(1−r̄))` across the splits (`r̄` = OOS relative rank of the IS-best); `< 0` ⇒ overfit-leaning. */
    medianLogit: number;
    /** Applied conventions, echoed (Law 2 report grammar). */
    assumptions: {
        conventionsVersion: string;
        [k: string]: unknown;
    };
    /** Structured warnings; always present (possibly empty). */
    diagnostics: {
        warnings: QuantWarning[];
    };
}
Fields, parameters and returned members (10)
Name · typeMeaning · unitRequired · default
assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
backtestOverfittingProbabilitynumber

Probability of backtest overfitting: the fraction of the C(S, S/2) symmetric train/test splits on which the in-sample-best configuration ranks **below the out-of-sample median** (logit λ < 0). Near 0.5 for noise (selection is worthless out of sample), near 0 for a genuinely persistent edge.

unitless by name
RequiredNo @default declared
combinationsnumber

Number of symmetric train/test splits evaluated: C(S, S/2).

unitless by name
RequiredNo @default declared
diagnostics{ warnings: QuantWarning[]; }

Structured warnings; always present (possibly empty).

unitless by name
RequiredNo @default declared
diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared
medianLogitnumber

Median logit λ = ln(r̄/(1−r̄)) across the splits (r̄ = OOS relative rank of the IS-best); < 0 ⇒ overfit-leaning.

unitless by name
RequiredNo @default declared
observationsnumber

Observations (rows) used after trimming to a multiple of S.

unitless by name
RequiredNo @default declared
splitsnumber

Blocks S actually used.

unitless by name
RequiredNo @default declared
trialsnumber

Number of strategy configurations (columns) N.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

DeflatedSharpeResult

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { DeflatedSharpeResult } from '@insiderfinance/totalfinance/risk/research';

export interface DeflatedSharpeResult {
    /** Applied conventions, echoed (Law 2 report grammar). */
    assumptions: {
        conventionsVersion: string;
        [k: string]: unknown;
    };
    /** Structured warnings; always present (possibly empty). */
    diagnostics: {
        warnings: QuantWarning[];
    };
    /** Probability the true Sharpe beats the multiple-testing-adjusted benchmark `SR₀`. */
    /** `null` when the statistics carry no Sharpe (a zero-variance series). */
    deflatedSharpe: number | null;
    /** The un-deflated PSR (benchmark 0), for comparison. */
    probabilisticSharpe: number | null;
    /** Expected maximum Sharpe across `trialCount` under the null — the deflation benchmark `SR₀`. */
    expectedMaxSharpe: number;
    trialCount: number;
}
Fields, parameters and returned members (8)
Name · typeMeaning · unitRequired · default
assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
deflatedSharpenumber | null

null when the statistics carry no Sharpe (a zero-variance series).

unitless by name
RequiredNo @default declared
diagnostics{ warnings: QuantWarning[]; }

Structured warnings; always present (possibly empty).

unitless by name
RequiredNo @default declared
diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared
expectedMaxSharpenumber

Expected maximum Sharpe across trialCount under the null — the deflation benchmark SR₀.

unitless by name
RequiredNo @default declared
probabilisticSharpenumber | null

The un-deflated PSR (benchmark 0), for comparison.

unitless by name
RequiredNo @default declared
trialCountnumber—count (integer)RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

LeakageIssue

#

One leaking split found by checkLeakage.

Signature
import type { LeakageIssue } from '@insiderfinance/totalfinance/risk/research';

// ───────────────────────── leakage & survivorship diagnostics ─────────────────────────
/** One leaking split found by {@link checkLeakage}. */
export interface LeakageIssue {
    /** Index of the leaking split. */
    split: number;
    /** How many indices appear in both train and test. */
    overlapCount: number;
    /** Up to 10 of the overlapping indices, as a sample. */
    sample: number[];
}
Fields, parameters and returned members (3)
Name · typeMeaning · unitRequired · default
overlapCountnumber

How many indices appear in both train and test.

count (integer)
RequiredNo @default declared
samplenumber[]

Up to 10 of the overlapping indices, as a sample.

unitless by name
RequiredNo @default declared
splitnumber

Index of the leaking split.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

LeakageReport

#

checkLeakage's report: the leak findings plus the Law 2 report grammar.

Signature
import type { LeakageReport } from '@insiderfinance/totalfinance/risk/research';

/** {@link checkLeakage}'s report: the leak findings plus the Law 2 report grammar. */
export interface LeakageReport {
    /** Applied conventions, echoed (Law 2 report grammar). */
    assumptions: {
        conventionsVersion: string;
        [k: string]: unknown;
    };
    /** The leakage warnings themselves (one `research.train_test_leakage` per leaking split). */
    diagnostics: {
        warnings: QuantWarning[];
    };
    /** `true` when no split leaks. */
    clean: boolean;
    /** Per-split leak details, aligned with `diagnostics.warnings`. */
    leaks: LeakageIssue[];
}
Fields, parameters and returned members (6)
Name · typeMeaning · unitRequired · default
assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
cleanboolean

true when no split leaks.

unitless by name
RequiredNo @default declared
diagnostics{ warnings: QuantWarning[]; }

The leakage warnings themselves (one research.train_test_leakage per leaking split).

unitless by name
RequiredNo @default declared
diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared
leaksLeakageIssue[]

Per-split leak details, aligned with diagnostics.warnings.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

type

MultipleTestMethod

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { MultipleTestMethod } from '@insiderfinance/totalfinance/risk/research';

// ───────────────────────── multiple-testing correction ─────────────────────────
export type MultipleTestMethod = 'bonferroni' | 'sidak' | 'holm' | 'benjaminiHochberg';

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

MultipleTestOptions

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { MultipleTestOptions } from '@insiderfinance/totalfinance/risk/research';

export interface MultipleTestOptions {
    /** Correction method (default `'holm'`). */
    method?: MultipleTestMethod;
    /** Significance level (default 0.05). */
    alpha?: number;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
alphanumber

Significance level (default 0.05).

unitless by name
OptionalNo @default declared
methodMultipleTestMethod

Correction method (default 'holm').

unitless by name
OptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

MultipleTestResult

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { MultipleTestResult } from '@insiderfinance/totalfinance/risk/research';

export interface MultipleTestResult {
    method: MultipleTestMethod;
    alpha: number;
    /** Adjusted p-values aligned with the input order. */
    adjusted: number[];
    /** Whether each hypothesis is rejected at `alpha` (`adjusted ≤ alpha`). */
    rejected: boolean[];
}
Fields, parameters and returned members (4)
Name · typeMeaning · unitRequired · default
adjustednumber[]

Adjusted p-values aligned with the input order.

unitless by name
RequiredNo @default declared
alphanumber—unitless by nameRequiredNo @default declared
methodMultipleTestMethod—unitless by nameRequiredNo @default declared
rejectedboolean[]

Whether each hypothesis is rejected at alpha (adjusted ≤ alpha).

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

ParameterSweepResult

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { ParameterSweepResult } from '@insiderfinance/totalfinance/risk/research';

// ───────────────────────── parameter-sweep diagnostics ─────────────────────────
export interface ParameterSweepResult {
    trialCount: number;
    bestSharpe: number;
    meanSharpe: number;
    varianceSharpe: number;
    /** Expected maximum Sharpe under the null (the deflation benchmark `SR₀`). */
    expectedMaxSharpe: number;
    /** Deflated Sharpe of the selected (best) configuration. */
    /** `null` when the selected statistics carry no Sharpe (a zero-variance series). */
    deflatedSharpe: number | null;
    /** Un-deflated PSR of the selected configuration; `null` with `deflatedSharpe`. */
    probabilisticSharpe: number | null;
}
Fields, parameters and returned members (7)
Name · typeMeaning · unitRequired · default
bestSharpenumber—unitless by nameRequiredNo @default declared
deflatedSharpenumber | null

null when the selected statistics carry no Sharpe (a zero-variance series).

unitless by name
RequiredNo @default declared
expectedMaxSharpenumber

Expected maximum Sharpe under the null (the deflation benchmark SR₀).

unitless by name
RequiredNo @default declared
meanSharpenumber—unitless by nameRequiredNo @default declared
probabilisticSharpenumber | null

Un-deflated PSR of the selected configuration; null with deflatedSharpe.

unitless by name
RequiredNo @default declared
trialCountnumber—count (integer)RequiredNo @default declared
varianceSharpenumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

type

ProbabilisticSharpeResult

#

probabilisticSharpeRatio's envelope: the probability plus the applied benchmark.

Signature
import type { ProbabilisticSharpeResult } from '@insiderfinance/totalfinance/risk/research';

/** {@link probabilisticSharpeRatio}'s envelope: the probability plus the applied benchmark. */
export type ProbabilisticSharpeResult = Computed<number | null, {
    benchmarkSharpe: number;
    observations: number;
}>;
Fields, parameters and returned members (49)

Loading 49 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

PurgedKFoldOptions

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { PurgedKFoldOptions } from '@insiderfinance/totalfinance/risk/research';

export interface PurgedKFoldOptions {
    /** Number of folds (≥ 2). */
    folds: number;
    /** Fraction of `n` to embargo after each test fold (default 0). */
    embargo?: number;
    /** Observations to purge on each side of a test fold (label-overlap buffer; default 0). */
    purgeGap?: number;
}
Fields, parameters and returned members (3)
Name · typeMeaning · unitRequired · default
embargonumber

Fraction of n to embargo after each test fold (default 0).

unitless by name
OptionalNo @default declared
foldsnumber

Number of folds (≥ 2).

unitless by name
RequiredNo @default declared
purgeGapnumber

Observations to purge on each side of a test fold (label-overlap buffer; default 0).

unitless by name
OptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

SharpeStatistics

#

Sample statistics of a return series needed for Sharpe inference. All in per-observation units.

Signature
import type { SharpeStatistics } from '@insiderfinance/totalfinance/risk/research';

// ───────────────────────── Sharpe inference ─────────────────────────
/** Sample statistics of a return series needed for Sharpe inference. All in per-observation units. */
export interface SharpeStatistics {
    /**
     * Per-observation Sharpe ratio `mean(excess)/std` (NOT annualized). `null` (C hygiene) when the
     * returns have zero variance: there is no dispersion to scale by, and the report says so.
     */
    sharpe: number | null;
    /** Number of observations. */
    observations: number;
    /** Skewness `γ₃` of the returns. */
    skewness: number;
    /** Non-excess kurtosis `γ₄` of the returns (3 for a normal distribution). */
    kurtosis: number;
}
Fields, parameters and returned members (4)
Name · typeMeaning · unitRequired · default
kurtosisnumber

Non-excess kurtosis γ₄ of the returns (3 for a normal distribution).

unitless by name
RequiredNo @default declared
observationsnumber

Number of observations.

unitless by name
RequiredNo @default declared
sharpenumber | null

Per-observation Sharpe ratio mean(excess)/std (NOT annualized). null (C hygiene) when the returns have zero variance: there is no dispersion to scale by, and the report says so.

unitless by name
RequiredNo @default declared
skewnessnumber

Skewness γ₃ of the returns.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

SharpeStatisticsReport

#

sharpeStatistics's report: the stats plus the applied conventions (Law 2 report grammar).

Signature
import type { SharpeStatisticsReport } from '@insiderfinance/totalfinance/risk/research';

/** {@link sharpeStatistics}'s report: the stats plus the applied conventions (Law 2 report grammar). */
export interface SharpeStatisticsReport extends SharpeStatistics {
    /** Applied conventions, echoed (Law 2 report grammar). */
    assumptions: {
        conventionsVersion: string;
        [k: string]: unknown;
    };
    /** Structured warnings; always present (possibly empty). */
    diagnostics: {
        warnings: QuantWarning[];
    };
}
Fields, parameters and returned members (8)
Name · typeMeaning · unitRequired · default
assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
diagnostics{ warnings: QuantWarning[]; }

Structured warnings; always present (possibly empty).

unitless by name
RequiredNo @default declared
diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared
kurtosisnumber

Non-excess kurtosis γ₄ of the returns (3 for a normal distribution).

unitless by name
RequiredNo @default declared
observationsnumber

Number of observations.

unitless by name
RequiredNo @default declared
sharpenumber | null

Per-observation Sharpe ratio mean(excess)/std (NOT annualized). null (C hygiene) when the returns have zero variance: there is no dispersion to scale by, and the report says so.

unitless by name
RequiredNo @default declared
skewnessnumber

Skewness γ₃ of the returns.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

Split

#

A train/test split as sorted index arrays into a length-n sample.

Signature
import type { Split } from '@insiderfinance/totalfinance/risk/research';

// ───────────────────────── cross-validation splitters ─────────────────────────
/** A train/test split as sorted index arrays into a length-`n` sample. */
export interface Split {
    train: number[];
    test: number[];
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
testnumber[]—unitless by nameRequiredNo @default declared
trainnumber[]—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

SurvivorshipContext

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { SurvivorshipContext } from '@insiderfinance/totalfinance/risk/research';

export interface SurvivorshipContext {
    /** Whether delisted / inactive instruments are included in the backtest universe. */
    includesDelisted?: boolean;
    /** Whether the universe is point-in-time (members as they were on each date). */
    pointInTimeUniverse?: boolean;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
includesDelistedboolean

Whether delisted / inactive instruments are included in the backtest universe.

unitless by name
OptionalNo @default declared
pointInTimeUniverseboolean

Whether the universe is point-in-time (members as they were on each date).

unitless by name
OptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

WalkForwardOptions

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { WalkForwardOptions } from '@insiderfinance/totalfinance/risk/research';

export interface WalkForwardOptions {
    /** Training window length (in observations). */
    trainSize: number;
    /** Test window length. */
    testSize: number;
    /** Step between successive folds (default `testSize`). */
    step?: number;
    /** `rolling` (sliding train window) or `anchored` (train always starts at 0). Default `rolling`. */
    mode?: 'rolling' | 'anchored';
}
Fields, parameters and returned members (4)
Name · typeMeaning · unitRequired · default
mode'rolling' | 'anchored'

rolling (sliding train window) or anchored (train always starts at 0). Default rolling.

unitless by name
OptionalNo @default declared
stepnumber

Step between successive folds (default testSize).

unitless by name
OptionalNo @default declared
testSizenumber

Test window length.

count (integer)
RequiredNo @default declared
trainSizenumber

Training window length (in observations).

count (integer)
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

adjustPValues

#

Adjust a set of p-values for multiple testing. Bonferroni/Šidák/Holm control the family-wise error rate; Benjamini–Hochberg controls the false-discovery rate. Returns adjusted p-values (input order) and the rejection decisions at alpha.

Signature
import { adjustPValues } from '@insiderfinance/totalfinance/risk/research';

export declare function adjustPValues(pValues: ArrayLike<number>, options?: MultipleTestOptions): MultipleTestResult;
Fields, parameters and returned members (8)
Name · typeMeaning · unitRequired · default
(options)MultipleTestOptions—unitless by nameOptionalNo @default declared
(options).alphanumber

Significance level (default 0.05).

unitless by name
OptionalNo @default declared
(options).methodMultipleTestMethod

Correction method (default 'holm').

unitless by name
OptionalNo @default declared
(pValues)ArrayLike<number>—unitless by nameRequiredNo @default declared
return.adjustednumber[]

Adjusted p-values aligned with the input order.

unitless by name
RequiredNo @default declared
return.alphanumber—unitless by nameRequiredNo @default declared
return.methodMultipleTestMethod—unitless by nameRequiredNo @default declared
return.rejectedboolean[]

Whether each hypothesis is rejected at alpha (adjusted ≤ alpha).

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

checkLeakage

#

Flag any split whose train and test index sets overlap (look-ahead leakage). The findings are research.train_test_leakage warnings on diagnostics.warnings (one per leaking split), with the structured per-split detail mirrored on leaks and a clean verdict.

Signature
import { checkLeakage } from '@insiderfinance/totalfinance/risk/research';

export declare function checkLeakage(splits: Split[]): LeakageReport;
Fields, parameters and returned members (7)
Name · typeMeaning · unitRequired · default
(splits)Split[]—unitless by nameRequiredNo @default declared
return.assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
return.assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
return.cleanboolean

true when no split leaks.

unitless by name
RequiredNo @default declared
return.diagnostics{ warnings: QuantWarning[]; }

The leakage warnings themselves (one research.train_test_leakage per leaking split).

unitless by name
RequiredNo @default declared
return.diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared
return.leaksLeakageIssue[]

Per-split leak details, aligned with diagnostics.warnings.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

deflatedSharpeRatio

#

Deflated Sharpe Ratio (Bailey & López de Prado 2014): the PSR evaluated against the *expected maximum* Sharpe that N independent trials would produce by chance, so selecting the best of a parameter sweep is penalised. Pass the trial Sharpes (variance computed for you) or trialCount plus their variance directly.

Signature
import { deflatedSharpeRatio } from '@insiderfinance/totalfinance/risk/research';

export declare function deflatedSharpeRatio(statistics: SharpeStatistics, trials: { trialSharpes: ArrayLike<number>; } | { trialCount: number; varianceSharpe: number; }): DeflatedSharpeResult;
Fields, parameters and returned members (17)

Loading 17 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

parameterSweepDiagnostics

#

Summarize a parameter sweep: given the per-trial Sharpes and the sample statistics of the *selected* (best) configuration's return series, report the dispersion of the trials and the deflated Sharpe — the honest probability the winner is real rather than the luckiest of many.

Signature
import { parameterSweepDiagnostics } from '@insiderfinance/totalfinance/risk/research';

export declare function parameterSweepDiagnostics(trialSharpes: ArrayLike<number>, selected: SharpeStatistics): ParameterSweepResult;
Fields, parameters and returned members (13)

Loading 13 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.