merton.calibration.covariance¶
MLE asymptotic standard errors and delta-method propagation.
When a calibrator returns the observed Fisher information (the Hessian of the negative log-likelihood at the MLE), this module turns it into:
the asymptotic covariance of the parameter estimates,
standard errors and Wald confidence intervals for each parameter,
propagated standard errors / CIs for derived quantities (DD, PD, spread) via the delta method.
The delta method gives Var[g(θ)] ≈ J · Σ · J^T where J = ∂g/∂θ is the
Jacobian of g at θ̂ and Σ is the asymptotic covariance of θ̂.
Classes¶
Symmetric (or empirical) confidence interval for a single quantity. |
Functions¶
|
Invert an observed-Fisher-information matrix to a covariance. |
|
Per-parameter standard errors = sqrt(diag(Σ)). |
|
Symmetric Wald CI |
|
Apply the delta method to a scalar function |
Module Contents¶
- class merton.calibration.covariance.ConfInt[source]¶
Symmetric (or empirical) confidence interval for a single quantity.
- merton.calibration.covariance.cov_from_hessian(hessian: numpy.ndarray) numpy.ndarray[source]¶
Invert an observed-Fisher-information matrix to a covariance.
Adds a tiny ridge for numerical stability if the matrix is nearly singular; raises
MertonErrorif it can’t be inverted at all.
- merton.calibration.covariance.standard_errors(cov: numpy.ndarray) merton._typing.FloatArray[source]¶
Per-parameter standard errors = sqrt(diag(Σ)).
- merton.calibration.covariance.wald_ci(estimate: float, se: float, *, level: float = 0.95, method: str = 'asymptotic') ConfInt[source]¶
Symmetric Wald CI
estimate ± z · se.
- merton.calibration.covariance.delta_method(g: collections.abc.Callable[[numpy.ndarray], float], theta: numpy.ndarray, cov: numpy.ndarray, *, eps: float | None = None) tuple[float, float][source]¶
Apply the delta method to a scalar function
gof the parameters.Returns
(g(theta), se_g)wherese_g² = J · Σ · JᵀandJis the gradient ofgcomputed by central finite differences.