The finance developer workbenchSearch the reference Development · 0.1.4 · unpublished

Public API / @insiderfinance/totalfinance

@insiderfinance/totalfinance/volatility/sticky-regime

import from '@insiderfinance/totalfinance/volatility/sticky-regime'

Every public export in this entry point, including type-only declarations. Search by name or concept.

Jump to an export (3)

StickyRegime · StickyRegimeInput · stickyRegime

interface

StickyRegime

The measured regime.

/** The measured regime. */
export interface StickyRegime {
    /**
     * `∂σ_K/∂lnS` — the empirical vol-spot beta from the regression, **per LOG spot** (vol points per
     * 100% spot move). NOT the same quantity as `VolatilitySpotBeta.volatilitySpotBeta` /
     * `minimumVarianceDelta({ volatilitySpotBeta })`, which are `∂σ/∂S` — per DOLLAR. The two differ by
     * a factor of `S`: feeding this straight into the hedge would scale the smile adjustment by the
     * spot price. Divide by the reference spot first (`estimateVolatilitySpotBeta` does exactly that
     * when its `basis` is `'log'`).
     */
    volatilitySpotBetaPerLogSpot: number;
    tStatistic: number;
    /** How much of the fixed-strike vol's change spot returns explain. */
    rSquared: number;
    /** Position on the axis: 0 = sticky-strike, 1 = sticky-moneyness (`= −β/skewSlope`); `null` if no reference. */
    stickiness: number | null;
    regime: 'sticky-strike' | 'sticky-moneyness' | 'intermediate' | 'indeterminate';
    observations: number;
    assumptions: {
        conventionsVersion: string;
        skewSlope: number | null;
    };
    diagnostics: Diagnostics;
}
Fields, parameters & returned members (27)
Name / typeMeaning & unitOptional / default
assumptions
{ conventionsVersion: string; skewSlope: number | null; }

unitless by name
Required / declared member
No @default declared; consult the signature and description.
assumptions.conventionsVersion
string

unitless by name
Required / declared member
No @default declared; consult the signature and description.
assumptions.skewSlope
number | null

unitless by name
Required / declared member
No @default declared; consult the signature and description.
diagnostics
Diagnostics

unitless by name
Required / declared member
No @default declared; consult the signature and description.
diagnostics.autoReason
string
When a meta-engine (e.g. `engines.auto()`) selected a delegate, this is a one-sentence, human-readable explanation of WHY that delegate was chosen (`engine` then names the delegate). Absent when no auto-selection took place.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.converged
boolean
Whether an iterative procedure converged. `false` means the value is not trustworthy.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.decomposition
Record<string, number>
Named intermediate quantities the value decomposes into — a par spread's protection leg and risky annuity, a forward variance's near/far legs. The H-series explain paths disclose their arithmetic here so a caller can audit the ratio, not just receive it (3B.3).
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.engine
string
Pricing/solver engine name, e.g. `black-scholes-merton`.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.finiteDifferenceBumps
Record<string, number>
Finite-difference engines: the ACTUAL bump sizes used for FD Greeks (spec P2.3) — adaptive near the vol/time boundaries, so the caller can see exactly what was differenced. Keys: `spotStep`, `volatilityStep`, `timeStepYears`, `rateStep`, and — extended Greeks only — `dividendYieldStep`. Each is the actual step differenced, in the unit of the coordinate it bumps. (This doc named the retired `hS`/`hSig`/`hT`/`hR`/`hQ` keys for one release after the emit sites had moved to the semantic names, so a caller following it read `undefined`.)
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.iterations
number
Iteration count for iterative methods.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.method
string
Numerical method, e.g. `closed-form`, `brent`, `finite-difference`.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.selection
import('@insiderfinance/totalfinance/core/pricing').SelectionReport
The structured engine-selection report (Gate C, `@insiderfinance/totalfinance/core/pricing`): who was selected, why, and — for automatic selection — every candidate considered with its verdict. This is the machine-readable superset of `engine` + `autoReason` (which remain for compatibility); `selected.name` always agrees with `engine` when both are present.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.selection.candidates
readonly import('@insiderfinance/totalfinance/core/pricing').SelectionCandidate[]
Candidates an automatic selection considered; absent for explicit mode.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.selection.mode
'explicit' | 'automatic'

unitless by name
Required / declared member
No @default declared; consult the signature and description.
diagnostics.selection.reason
string
Why the selected engine answers this request.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
diagnostics.selection.selected
{ name: string; version?: string; }

unitless by name
Required / declared member
No @default declared; consult the signature and description.
diagnostics.selection.selected.name
string

unitless by name
Required / declared member
No @default declared; consult the signature and description.
diagnostics.selection.selected.version
string

unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.timingMs
number
Wall-clock timing in milliseconds, when measured.
milliseconds
Optional
No @default declared; consult the signature and description.
diagnostics.warmup
number
Series facades: number of leading output slots that are warmup sentinels (null/NaN) while the computation seeds. Equals the input length when the indicator never emitted.
unitless by name
Optional
No @default declared; consult the signature and description.
diagnostics.warnings
QuantWarning[]
Structured warnings; always present (possibly empty).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
observations
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
rSquared
number
How much of the fixed-strike vol's change spot returns explain.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
regime
'indeterminate' | 'sticky-strike' | 'sticky-moneyness' | 'intermediate'

unitless by name
Required / declared member
No @default declared; consult the signature and description.
stickiness
number | null
Position on the axis: 0 = sticky-strike, 1 = sticky-moneyness (`= −β/skewSlope`); `null` if no reference.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
tStatistic
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
volatilitySpotBetaPerLogSpot
number
`∂σ_K/∂lnS` — the empirical vol-spot beta from the regression, **per LOG spot** (vol points per 100% spot move). NOT the same quantity as `VolatilitySpotBeta.volatilitySpotBeta` / `minimumVarianceDelta({ volatilitySpotBeta })`, which are `∂σ/∂S` — per DOLLAR. The two differ by a factor of `S`: feeding this straight into the hedge would scale the smile adjustment by the spot price. Divide by the reference spot first (`estimateVolatilitySpotBeta` does exactly that when its `basis` is `'log'`).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

interface

StickyRegimeInput

Inputs for {@link stickyRegime}.

/** Inputs for {@link stickyRegime}. */
export interface StickyRegimeInput {
    /** Per-observation underlying spot, aligned to `fixedStrikeVolatility`. */
    spot: ArrayLike<number>;
    /** Per-observation implied vol of a FIXED reference strike (same K across the series). */
    fixedStrikeVolatility: ArrayLike<number>;
    /** The smile slope `∂σ/∂ln(K)` — the sticky-moneyness reference. Omit ⇒ only `β`/R² (indeterminate). */
    skewSlope?: number;
}
Fields, parameters & returned members (3)
Name / typeMeaning & unitOptional / default
fixedStrikeVolatility
ArrayLike<number>
Per-observation implied vol of a FIXED reference strike (same K across the series).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
skewSlope
number
The smile slope `∂σ/∂ln(K)` — the sticky-moneyness reference. Omit ⇒ only `β`/R² (indeterminate).
unitless by name
Optional
No @default declared; consult the signature and description.
spot
ArrayLike<number>
Per-observation underlying spot, aligned to `fixedStrikeVolatility`.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

function

stickyRegime

Measure whether the market's smile is sticky-strike or sticky-moneyness (sticky-delta) from a history of spot and a fixed reference strike's implied vol. See `docs/specs/sticky-regime.md`.

export declare function stickyRegime(input: StickyRegimeInput): StickyRegime;
Fields, parameters & returned members (14)
Name / typeMeaning & unitOptional / default
(input)
StickyRegimeInput

unitless by name
Required / declared member
No @default declared; consult the signature and description.
(input).fixedStrikeVolatility
ArrayLike<number>
Per-observation implied vol of a FIXED reference strike (same K across the series).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
(input).skewSlope
number
The smile slope `∂σ/∂ln(K)` — the sticky-moneyness reference. Omit ⇒ only `β`/R² (indeterminate).
unitless by name
Optional
No @default declared; consult the signature and description.
(input).spot
ArrayLike<number>
Per-observation underlying spot, aligned to `fixedStrikeVolatility`.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.assumptions
{ conventionsVersion: string; skewSlope: number | null; }

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.assumptions.conventionsVersion
string

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.assumptions.skewSlope
number | null

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.diagnostics
Diagnostics

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.observations
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.rSquared
number
How much of the fixed-strike vol's change spot returns explain.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.regime
'indeterminate' | 'sticky-strike' | 'sticky-moneyness' | 'intermediate'

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.stickiness
number | null
Position on the axis: 0 = sticky-strike, 1 = sticky-moneyness (`= −β/skewSlope`); `null` if no reference.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.tStatistic
number

unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.volatilitySpotBetaPerLogSpot
number
`∂σ_K/∂lnS` — the empirical vol-spot beta from the regression, **per LOG spot** (vol points per 100% spot move). NOT the same quantity as `VolatilitySpotBeta.volatilitySpotBeta` / `minimumVarianceDelta({ volatilitySpotBeta })`, which are `∂σ/∂S` — per DOLLAR. The two differ by a factor of `S`: feeding this straight into the hedge would scale the smile adjustment by the spot price. Divide by the reference spot first (`estimateVolatilitySpotBeta` does exactly that when its `basis` is `'log'`).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.