loglik_niche: Negative log likelihood of an ellipsoid corrected with...

View source: R/loglik_niche.R

loglik_nicheR Documentation

Negative log likelihood of an ellipsoid corrected with environmental combinations which come from the area of study (M)

Description

Negative log likelihood of an ellipsoid corrected with environmental combinations which come from the area of study (M)

Usage

loglik_niche(mu, s_mat, env_occ, env_m, neg = TRUE)

Arguments

mu

A vector mu of parameters

s_mat

The covariance matrix from environmental data frame

env_occ

A data.frame containing the original sample of environmental combinations that correspond to presences

env_m

A data.frame containing a second random sample of environmental

neg

Logical. Default TRUE, returns the negative of the likelihood

Value

A negative log likelihood value

Examples

loglik_niche(
  mu = example_mu_vec,
  s_mat = example_s_mat,
  env_occ = example_env_occ_2d,
  env_m = example_env_m_2d
)
# Example with log of the likelihood
loglik_niche(
  mu = example_mu_vec,
  s_mat = example_s_mat,
  env_occ = example_env_occ_2d,
  env_m = example_env_m_2d,
  neg = FALSE
)

xnicher documentation built on Sept. 15, 2026, 5:08 p.m.