Skip to contents

MaxentFeatures: linear, quadratic, product and hinge features (scaled by the covariate ranges). MaxentFit: the Gibbs distribution over background points (presences appended when add_presence) minimising -mean_presence eta + log sum_b exp(eta) + (l2/2)||lambda||^2 + l1 ||lambda||_1, by Newton steps (no lasso) or soft-thresholded coordinate descent. MaxentPredict: raw, logistic and cloglog outputs. LocohHomeRange: k-LoCoH isopleths, the union of the smallest local hulls covering a fraction of the points, with exact union areas.

Usage

MaxentFeatures(X, classes = "lq", hinge_knots = 5, ranges = NULL)

MaxentFit(
  presence,
  background,
  l2 = 0,
  l1 = 0,
  add_presence = TRUE,
  max_iter = 500,
  tol = 1e-12
)

MaxentPredict(fit, features, output = "cloglog")

LocohHomeRange(points, k, levels = c(0.5, 0.95))

Arguments

X

Covariate matrix.

classes

Feature classes: l, q, p, h.

hinge_knots

Number of hinge knots per covariate.

ranges

List of (min, max) per covariate, or NULL.

presence, background

Feature matrices of presence and background points.

l2, l1

Ridge and lasso penalties.

add_presence

Append presences to the background.

max_iter, tol

Iteration limit and tolerance.

fit

Result of MaxentFit.

features

Feature matrix to predict at.

output

"raw", "logistic" or "cloglog".

points

Location matrix (two columns).

k

Neighbourhood size (point plus k - 1 neighbours).

levels

Isopleth levels.

Value

A list or numeric vector.

References

Phillips, S. J., Anderson, R. P. and Schapire, R. E. (2006). Ecol. Modelling 190, 231-259. Phillips, S. J. et al. (2017). Ecography 40, 887-893. Dudik, M., Phillips, S. J. and Schapire, R. E. (2004). COLT 2004, 472-486. Getz, W. M. and Wilmers, C. C. (2004). Ecography 27, 489-505.

Examples

f <- MaxentFit(rbind(1, 0.8), rbind(0, 0.5, 1), add_presence = FALSE)
MaxentPredict(f, rbind(0, 1), output = "raw")
#> [1] 0.02629658 0.82629658