batchMarkOptim | R Documentation |
batchMarkOptim function optimizes batchMarkHmmLL
function.
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,
...
)
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 |
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.
For batchMarkOptim
, a list with components:
The survival probability and remaining in the population between occasion t and t+1.
The capture probability at occasion time t.
The optimized log-likelihood value of marked model.
The standard error for each parameter.
The Akaike Information Criteria for model selection.
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.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.