Monte Carlo Adjusted Profile

pypomp.mcap.mcap(parameter: ArrayLike, loglik: ArrayLike, *, level: float = 0.95, span: float = 0.75, n_grid: int = 1000, loess_degree: int = 2) MCAPResult[source]

Monte Carlo adjusted profile.

Given a collection of points maximizing the likelihood over a range of fixed values of a focal parameter, this function constructs a profile likelihood confidence interval accommodating both Monte Carlo error in the profile and statistical uncertainty present in the likelihood function.

Parameters:
  • parameter (npt.ArrayLike) – The parameter values at which the log-likelihood was evaluated.

  • loglik (npt.ArrayLike) – The log-likelihood values corresponding to the parameter values.

  • level (float, optional) – The confidence level to construct the profile likelihood confidence interval for.

  • span (float, optional) – The span parameter for the loess smoother.

  • n_grid (int, optional) – The number of grid points to evaluate the smoothed log-likelihood at.

  • loess_degree (int, optional) – The degree of the loess smoother.

Returns:

MCAPResult – The MCAP result object containing the profile likelihood confidence interval and other statistics.

Return type:

MCAPResult

class pypomp.mcap.MCAPResult(level: float, mle: float, ci: Tuple[float | None, float | None], delta: float, se_stat: float, se_mc: float, se_total: float, fit: Dict[str, ndarray[tuple[Any, ...], dtype[floating[Any]]]], quadratic_max: float, quadratic_coef: Dict[str, float], vcov: ndarray[tuple[Any, ...], dtype[floating[Any]]])[source]

Bases: object

Results of a Monte Carlo adjusted profile (MCAP) analysis.

Attributes

level

The confidence level of the profile likelihood confidence interval.

mle

The maximum likelihood estimate of the focal parameter, taken as the argmax of the smoothed profile.

ci

The profile likelihood confidence interval (lower, upper).

delta

The log-likelihood threshold used to define the confidence interval, relative to the maximum.

se_stat

The standard error due to statistical uncertainty (sampling variance).

se_mc

The standard error due to Monte Carlo noise in the likelihood estimates.

se_total

The total standard error, calculated as the root sum of squares of se_stat and se_mc.

fit

A dictionary containing the grid of parameters ('parameter'), the smoothed log-likelihood values ('smoothed'), and the local quadratic fit values ('quadratic').

quadratic_max

The parameter value that maximizes the local quadratic fit.

quadratic_coef

c - ax^2 + bx.

vcov

The variance-covariance matrix of the quadratic coefficients a and b.