| log_likelihood2 | R Documentation |
This function computes the negative log-likelihood for a beta-binomial regression model where both the alpha and beta parameters are modeled as functions of predictors (mode 2).
log_likelihood2(params, X, Z, y, n, weights = NULL, lch = NULL)
params |
A numeric vector containing all model parameters. The first n_alpha elements are coefficients for the alpha model, and the remaining elements are coefficients for the beta model. |
X |
A matrix of predictors for the alpha model. |
Z |
A matrix of predictors for the beta model. |
y |
A numeric vector of response values. |
n |
The maximum score (number of trials). |
weights |
A numeric vector of weights for each observation (NULL = equal weights). |
lch |
Optional precomputed |
Uses a numerically stable implementation of the beta-binomial
log-probability via lbeta. The linear predictors of
log(alpha) and log(beta) are clamped to [-20, 20].
The negative log-likelihood of the model (large finite penalty if non-finite).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.