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:
- 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:
objectResults of a Monte Carlo adjusted profile (MCAP) analysis.
Attributes
The confidence level of the profile likelihood confidence interval. |
|
The maximum likelihood estimate of the focal parameter, taken as the argmax of the smoothed profile. |
|
The profile likelihood confidence interval (lower, upper). |
|
The log-likelihood threshold used to define the confidence interval, relative to the maximum. |
|
The standard error due to statistical uncertainty (sampling variance). |
|
The standard error due to Monte Carlo noise in the likelihood estimates. |
|
The total standard error, calculated as the root sum of squares of se_stat and se_mc. |
|
A dictionary containing the grid of parameters ('parameter'), the smoothed log-likelihood values ('smoothed'), and the local quadratic fit values ('quadratic'). |
|
The parameter value that maximizes the local quadratic fit. |
|
c - ax^2 + bx. |
|
The variance-covariance matrix of the quadratic coefficients a and b. |