batchMarkOptim {extBatchMarking} | R Documentation |
Marked model only.
Description
batchMarkOptim function provides the batch marking function to be optimized.
Usage
batchMarkOptim(
par = NULL,
data,
choiceModel = c("model1", "model2", "model3", "model4"),
method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B"),
parallel = FALSE,
lowerBound = -Inf,
cores = 1,
hessian = FALSE,
control,
...
)
Arguments
par |
Initial values for the parameters to be optimized over. |
data |
A capture-recapture data matrix or data frame |
choiceModel |
This chooses among different models and allow for model selection |
method |
The method to be used. See |
parallel |
Logical. Should the algorithm be run in parallel? This will be implemented in a future version. |
lowerBound |
Lower bounds on the variables for the "L-BFGS-B" |
cores |
The number of cores for parallelization |
hessian |
Logical. Should a numerically differentiated Hessian matrix be returned? |
control |
A list of control parameters. See optim for details. |
... |
Further arguments to be passed by user which goes into the |
Details
Note that arguments after ... must be matched exactly.
batchMarkOptim
depends on optim
function to optimize the parameters of the marked model only. By default optim performs minimization.
Value
For batchMarkOptim
, a list with components:
- phi
The survival probability and remaining in the population between occasion t and t+1.
- p
The capture probability at occasion time t.
- ll
The optimized log-likelihood value of marked model.
- hessian
The hessian matrix.
- AIC
The Akaike Information Criteria for model selection.
References
Laura L. E. Cowen, Panagiotis Besbeas, Byron J. T. Morgan, 2017.: Hidden Markov Models for Extended Batch Data, Biometrics, 73, 1321-1331. DOI: 10.1111/biom.12701.
Examples
# Load the package
library(extBatchMarking)
# Load the WeatherLoach data from Cowen et al., 2017.
data(WeatherLoach)
# Initial parameter values
theta <- c(0, -1)
mod1 <- batchMarkOptim(
par = theta,
data = WeatherLoach,
choiceModel = "model4",
method = "BFGS",
parallel = FALSE,
hessian = TRUE,
control = list(trace = 1)
)
# Survival probability
mod1$phi
# Capture probability
mod1$p
# Optimized log-likelihood
mod1$ll
# The Hessian matrix
mod1$hessian
# The Aikaike Information Criteria
mod1$AIC
mod2 <- batchMarkOptim(
par = theta,
data = WeatherLoach,
choiceModel = "model4",
method = "L-BFGS-B",
parallel = FALSE,
hessian = TRUE,
control = list(trace = 1))
# Survival probability
mod2$phi
# Capture probability
mod2$p
# Optimized log-likelihood
mod2$ll
# The Hessian matrix
mod2$hessian
# The Akaike Information Criteria
mod2$AIC