spey.math.hessian

Contents

spey.math.hessian#

spey.math.hessian(statistical_model: StatisticalModel, expected: ExpectationType = ExpectationType.observed, data: List[float] | None = None) Callable[[ndarray], ndarray][source]#

Retreive the function to compute Hessian of negative log-likelihood

\[{\rm Hessian} = -\frac{\partial^2\mathcal{L}(\theta)}{\partial\theta_i\partial\theta_j}\]

New in version 0.1.6.

Parameters:
  • statistical_model (StatisticalModel) – statistical model to be used.

  • expected (ExpectationType) –

    Sets which values the fitting algorithm should focus and p-values to be computed.

    • observed: Computes the p-values with via post-fit prescriotion which means that the experimental data will be assumed to be the truth (default).

    • aposteriori: Computes the expected p-values with via post-fit prescriotion which means that the experimental data will be assumed to be the truth.

    • apriori: Computes the expected p-values with via pre-fit prescription which means that the SM will be assumed to be the truth.

  • data (List[float], default None) – input data that to fit. If None observed data will be used.

Returns:

function to compute hessian of negative log-likelihood

Return type:

Callable[[np.ndarray], np.ndarray]