| gradient_log_likelihood | R Documentation |
Computes the exact gradient of log_likelihood with respect
to all regression coefficients. With r = (y - \mu)/\sigma:
\partial\ell/\partial\mu = r/\sigma, \qquad
\partial\ell/\partial\log\sigma = r^2 - 1.
Coefficient gradients follow via the chain rule through the design
matrices. Contributions of observations whose log(sigma) linear predictor
is clamped (see log_likelihood) are zeroed, which is the exact
subgradient of the clamped objective. Non-finite per-observation terms
(matching the penalty branch of the objective) are zeroed as well.
gradient_log_likelihood(params, X, Z, y, weights = NULL)
params |
A numeric vector containing all model parameters. The first n_beta elements are coefficients for the mean model, and the remaining elements are coefficients for the log-standard deviation model. |
X |
A matrix of predictors for the mean model. |
Z |
A matrix of predictors for the log-standard deviation model. |
y |
A numeric vector of response values. |
weights |
A numeric vector of weights for each observation (NULL = equal weights). |
Numeric vector: gradient of the negative log-likelihood with
respect to params.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.