Skip to contents

Extracts posterior summaries of the niche centroid (mu), standard deviations (sigma), covariance matrix (Sigma) and correlation matrix (R_corr) from a fitted Bayesian presence-only niche model.

Usage

extract_pars(fit, prob = 0.95)

Arguments

fit

A CmdStanMCMC object returned by fit_niche.

prob

Numeric, credible interval probability (default 0.95).

Value

A list with components:

mu

Data frame with posterior summary of the centroid (mean, sd, and credible interval for each dimension).

sigma

Data frame with posterior summary of the standard deviations (mean, sd, and credible interval for each dimension).

Sigma

Posterior mean of the covariance matrix (P x P matrix).

R_corr

Posterior mean of the correlation matrix (P x P matrix).

Examples

if (FALSE) { # \dontrun{
fit <- fit_niche(occ, chains = 2)
pars <- extract_pars(fit)
pars$mu       # centroid posterior summary
pars$sigma    # tolerance posterior summary
pars$Sigma    # posterior mean covariance matrix
pars$R_corr   # posterior mean correlation matrix

# Geographic interpretation: project the 95% Mahalanobis ellipsoid
# onto the environmental raster to get spatial habitat suitability.
} # }