batchMarkOptim {extBatchMarking} | R Documentation |
Marked model only.
Description
batchMarkOptim function optimizes batchMarkHmmLL
function.
Usage
batchMarkOptim(
par = NULL,
data,
covariate_phi = NULL,
covariate_p = NULL,
choiceModel = c("model1", "model2", "model3", "model4"),
method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B"),
lowerBound = -Inf,
control,
...
)
Arguments
par |
Initial values for the parameters to be optimized over. |
data |
A capture-recapture data matrix or data frame |
covariate_phi |
This covariate placeholder for the parameter phi_t |
covariate_p |
This covariate placeholder for the parameter p_t |
choiceModel |
This chooses among different models and allow for model selection |
method |
The method to be used. See |
lowerBound |
Lower bounds on the variables for the "L-BFGS-B" |
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.
- SE
The standard error for each parameter.
- 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",
control = list(trace = 1),
covariate_phi = NULL,
covariate_p = NULL)
# print(mod1)
# Survival probability
mod1$phi
# Capture probability
mod1$p
# Optimized log-likelihood
mod1$ll
# The Aikaike Information Criteria
mod1$AIC
mod2 <- batchMarkOptim(
par = theta,
data = WeatherLoach,
choiceModel = "model4",
method = "L-BFGS-B",
control = list(trace = 1),
covariate_phi = NULL,
covariate_p = NULL)
# print(mod2)
# Survival probability
mod2$phi
# Capture probability
mod2$p
# Optimized log-likelihood
mod2$ll
# The Akaike Information Criteria
mod2$AIC