profile.eicm {eicm} | R Documentation |
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 class 'eicm'
profile(
fitted,
all.pars = TRUE,
parmatrix,
species,
parameter,
step = 0.3,
ncores = parallel::detectCores(),
alpha = 0.01,
...
)
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 |
parameter |
if all.pars=FALSE, in which column of |
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.
Value
The same model object updated with a new profile
component.
Note
Confidence intervals should not be computed on a model whose terms have been selected.
This function is optimized for computing profiles of multiple parameters simultaneously (in parallel).
Examples
# 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)