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[floating[Any]]], quadratic_max: float, quadratic_coef: Dict[str, float], vcov: NDArray[floating[Any]])[source]

Bases: object

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

Attributes

MCAPResult.level: float

The confidence level of the profile likelihood confidence interval.

MCAPResult.mle: float

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

MCAPResult.ci: Tuple[float | None, float | None]

The profile likelihood confidence interval (lower, upper).

MCAPResult.delta: float

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

MCAPResult.se_stat: float

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

MCAPResult.se_mc: float

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

MCAPResult.se_total: float

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

MCAPResult.fit: Dict[str, NDArray[floating[Any]]]

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

MCAPResult.quadratic_max: float

The parameter value that maximizes the local quadratic fit.

MCAPResult.quadratic_coef: Dict[str, float]

c - ax^2 + bx.

Type:

The coefficients of the local quadratic fit

MCAPResult.vcov: NDArray[floating[Any]]

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