Compute negative log-likelihood for EcoState model
compute_nll(
p,
taxa,
years,
noB_i,
type_i,
n_species,
project_vars,
DC_ij,
Bobs_ti,
Cobs_ti,
Nobs_ta_g2,
Wobs_ta_g2,
log_prior,
fit_eps,
fit_nu,
stanza_data,
settings,
control
)
The joint negative log-likelihood including contribution of priors and fit to data.
list of parameters
Character vector of taxa included in model.
Integer-vector of years included in model
Boolean vector indicating which taxa have no B value
character vector indicating whether a taxon is "hetero", "auto", or "detritus"
number of species
function to integrate differential equation
Diet projections matrix
formatted matrix of biomass data
formatted matrix of catch data
formatted list of age-comp data
formatted list of weight-at-age data
A user-provided function that takes as input the list of
parameters out$obj$env$parList()
where out
is the output from
ecostate()
, and returns a numeric vector
where the sum is the log-prior probability. For example
log_prior = function(p) dnorm( p$logq_i[1], mean=0, sd=0.1, log=TRUE)
specifies a lognormal prior probability for the catchability coefficient
for the first taxa
with logmean of zero and logsd of 0.1
Character-vector listing taxa
for which the
model should estimate annual process errors in dB/dt
Character-vector listing taxa
for which the
model should estimate annual process errors in consumption Q_ij
output from make_stanza_data
Output from stanza_settings()
, used to define age-structured
dynamics (called stanza-groups).
output from ecostate_control
Given a list of parameters, calculates the joint negative log-likelihood, where the Laplace approximation is then used to marginalize across random effects to calculate the log-marginal likelihood of fixed effects. The joint likelihood includes the fit to fishery catches, biomass indices, age-composition data, weight-at-age data, priors, and the distribution for random effects.