| like_comp | R Documentation |
Returns the log-likelihood for composition data, e.g., length, age, or stock composition, with various statistical distributions supported.
like_comp(
obs,
pred,
type = c("multinomial", "dirmult1", "dirmult2", "lognormal"),
N = sum(obs),
theta,
stdev
)
obs |
A vector of observed values. Internally converted to proportions. |
pred |
A vector of predicted values. Same length as |
type |
Character for the desired distribution |
N |
Numeric, the sample size corresponding to |
theta |
Numeric, the linear ( |
stdev |
Numeric or vectorized for |
Observed and predicted vectors are internally converted to proportions.
For type = "lognormal", zero observations are removed from the likelihood calculation.
Numeric representing the log-likelihood.
Thorson et al. 2017. Model-based estimates of effective sample size in stock assessment models using the Dirichlet-multinomial distribution. Fish. Res. 192:84-93. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.fishres.2016.06.005")}
M <- 0.1
age <- seq(1:10)
pred <- exp(-M * age)
obs <- pred * rlnorm(10, sd = 0.05)
like_comp(obs, pred, N = 10, type = "multinomial")
like_comp(obs, pred, N = 100, type = "multinomial")
like_comp(obs, pred, N = 10, type = "dirmult1", theta = 1)
like_comp(obs, pred, N = 10, type = "dirmult1", theta = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.