pypomp.maths.logmeanexp

pypomp.maths.logmeanexp(x: Any, axis: None = None, ignore_nan: bool = False) float[source]
pypomp.maths.logmeanexp(x: Any, axis: int | tuple[int, ...], ignore_nan: bool = False) ndarray

Calculates the mean likelihood for an array of log-likelihoods, and returns the corresponding log-likelihood. This is appropriate when the estimator is unbiased on the natural scale.

Parameters:
  • x (array-like) – collection of log-likelihoods

  • axis (int, tuple, or None) – axis or axes along which to compute the mean. If None (default), compute over the entire array.

  • ignore_nan (bool) – if True, drop NaNs (or treat as -inf in exp space) before computing.