View source: R/niche_presence_only.R
| niche_presence_only | R Documentation |
Fits a multivariate normal niche model using only presence records, with no background correction (Jimenez et al. 2019, Eq. 2). Uses the compiled C++ backend via an external pointer for fast evaluation.
niche_presence_only(occ, eta = 1, start = NULL, ...)
occ |
Numeric matrix ( |
eta |
Numeric scalar, shape parameter for the LKJ C-vine prior on the correlation matrix (default 1 = uniform over correlations). |
start |
A numeric vector (single-start) or list of numeric vectors (multi-start). Use [start_theta()] or [start_theta_multiple()] to generate starting values. |
... |
Ignored. Present for wrapper compatibility. |
The minimised objective is the negative log-likelihood of the unconstrained multivariate normal:
-\log\mathcal{L} =
\frac{n}{2}\log|\Sigma|
+ \frac{1}{2}\sum_{i=1}^{n} q_i
where q_i = (\mathbf{x}_i - \mu)^\top \Sigma^{-1}
(\mathbf{x}_i - \mu).
Supports both single-start (start is a numeric vector) and
multi-start (start is a list of numeric vectors) optimisation.
A list with components:
thetaBest parameter vector.
valueNegative log-likelihood at the optimum.
convConvergence code (0 = success).
all_resultsData frame of all starts (multi-start only).
Jimenez, L., Soberon, J., Christen, J. A., & Soto, D. (2019). On the problem of modeling a fundamental niche from occurrence data. Ecological Modelling, 397, 109823.
[optimize_niche()] for the unified fitting interface, [loglik_niche_math_presence_only()] for the R-level log-likelihood.
occ <- as.matrix(example_env_occ_3d)
theta0 <- start_theta(example_env_occ_3d)
res <- niche_presence_only(occ = occ, start = theta0)
res$value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.