Learn R Programming

eicm (version 1.0.3)

profile.eicm: Likelihood profiles for EICMs

Description

Computes the profile (penalized) likelihood for all (or only one) estimated parameters in a EICM model.

Usage

# S3 method for eicm
profile(
  fitted,
  all.pars = TRUE,
  parmatrix,
  species,
  parameter,
  step = 0.3,
  ncores = parallel::detectCores(),
  alpha = 0.01,
  ...
)

Value

The same model object updated with a new profile component.

Arguments

fitted

the fitted EICM model.

all.pars

logical. Compute for all model parameters?

parmatrix

if all.pars=FALSE, in which matrix is the parameter of interest, "env" or "sp"?

species

if all.pars=FALSE, in which row of parmatrix is the parameter of interest?

parameter

if all.pars=FALSE, in which column of parmatrix is the parameter of interest?

step

the step increments/decrements at which to compute the likelihood profile points.

ncores

the number of CPU cores to use when computing profiles for all parameters.

alpha

highest significance level that will be guaranteed for this profile.

...

additional argument(s) for methods

Details

Likelihod profiles will use the same regularization settings that were used in model fitting.

Examples

Run this code
# \donttest{
# load the included parameterized model
data(truemodel)

# realize the model
occurrences <- predict(truemodel, nrepetitions=1)

# fit the model without species interactions
fitted <- eicm(occurrences, n.latent=2, mask.sp=0, do.selection=FALSE)$fitted.model

# compute likelihood profiles for all parameters
fitted <- profile(fitted, ncores=2)

# plot the first 9 profiles
par(mfrow=c(3, 3))
dummy <- lapply(fitted$profile[1:9], plot)
# }

Run the code above in your browser using DataLab