Skip to contents

Similar to others, this engine enables the fitting and prediction of log-Gaussian Cox process (LGCP) and Inhomogeneous Poisson process (IPP) processes. It uses the scampr package, which uses maximum likelihood estimation fitted via TMB (Template Model Builder).

It also support the addition of spatial latent effects which can be added via Gaussian fields and approximated by 'FRK' (Fixed Rank Kriging) and are integrated out using either variational or Laplace approximation.

The main use case for this engine is as an alternative to engine_inlabru() and engine_inla() for fitting iSDMs, e.g. those combining both presence-only and presence-absence point occurrence data.


engine_scampr(x, type = "response", dens = "posterior", maxit = 500, ...)



distribution() (i.e. BiodiversityDistribution) object.


The mode used for creating (posterior or prior) predictions. Either stting "link" or "response" (Default: "response").


A character on how predictions are made, either from the "posterior" (Default) or "prior".


A numeric on the number of iterations for the optimizer (Default: 500).


Other parameters passed on.


An Engine.


This engine may only be used to predict for one or two datasets at most. It supports only presence-only PPMs and presence/absence Binary GLMs, or 'IDM' (for an integrated data model).


  • The package can currently be installed from github directly only "ElliotDovers/scampr"

  • Presence-absence models in SCAMPR currently only support cloglog link functions!


  • Dovers, E., Popovic, G. C., & Warton, D. I. (2024). A fast method for fitting integrated species distribution models. Methods in Ecology and Evolution, 15(1), 191-203.

  • Dovers, E., Stoklosa, D., and Warton D. I. (2024). Fitting log-Gaussian Cox processes using generalized additive model software. The American Statistician, 1-17.


if (FALSE) {
# Load background
background <- terra::rast(system.file('extdata/europegrid_50km.tif',
package='ibis.iSDM',mustWork = TRUE))

# Add GLM as an engine
x <- distribution(background) |> engine_scampr()