merton.calibration.bootstrap

Block bootstrap for time-series calibrators.

The moving / circular block bootstrap (Politis & Romano, 1994) resamples contiguous blocks of length b from a return series of length n to preserve serial dependence. For an equity series we bootstrap log-returns (stationary by Merton assumption), reconstruct equity paths from each resample, refit the calibrator, and report empirical percentile CIs of any chosen scalar function of the fitted parameters.

Classes

Functions

block_bootstrap_calibration(→ BootstrapResult)

Block-bootstrap a time-series calibrator.

Module Contents

class merton.calibration.bootstrap.BootstrapResult[source]

Output of block_bootstrap_calibration().

parameter_samples: dict[str, merton._typing.FloatArray][source]
derived_samples: dict[str, merton._typing.FloatArray][source]
n_resamples: int = 0[source]
block_length: int = 0[source]
ci(name: str, level: float = 0.95) merton.calibration.covariance.ConfInt[source]

Percentile CI for parameter name (or any derived quantity).

merton.calibration.bootstrap.block_bootstrap_calibration(equity_series: merton._typing.FloatArray, refit: collections.abc.Callable[[merton._typing.FloatArray], dict[str, float]], *, n_resamples: int = 200, block_length: int | None = None, seed: int | None = None, derived: dict[str, collections.abc.Callable[[dict[str, float]], float]] | None = None) BootstrapResult[source]

Block-bootstrap a time-series calibrator.

Parameters:
  • equity_series – The 1-D equity time series the original calibration was fit on.

  • refit – Callable: refit(resampled_series) -> {"asset_vol": ..., "asset_drift": ..., ...}. It must accept a same-length equity series and return a parameter dict.

  • n_resamples – Number of bootstrap replications. 200 is a sane default for CIs; bump to 1 000+ for tighter percentile estimates.

  • block_length – Length of each contiguous block. Defaults to round(n ** (1/3)) per Politis-Romano.

  • seed – RNG seed for reproducibility.

  • derived – Optional dict mapping name → f(params_dict) -> float. Each function is evaluated on each resample to give CI’s for derived quantities (e.g. DD or PD at the calibrated point).