log_likelihood: Calculate the negative log-likelihood for a beta binomial...

View source: R/betaBinomial.R

log_likelihoodR Documentation

Calculate the negative log-likelihood for a beta binomial regression model

Description

This function computes the negative log-likelihood for a beta binomial regression model where both the mean and standard deviation are modeled as functions of predictors.

Usage

log_likelihood(params, X, Z, y, weights)

Arguments

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.

Value

The negative log-likelihood of the model.


WLenhard/cNORM documentation built on Nov. 30, 2024, 4:45 p.m.