Negative Log-Likelihood for Compound Poisson-Normal Regression
cpn_neg_log_likelihood.Rd
Computes the negative log-likelihood for a regression model where the response is assumed to follow a Compound Poisson-Normal distribution.
Arguments
- beta_mu_sigma
Numeric vector. Contains the regression coefficients for the log-link Poisson mean (
lambda
), followed by the mean (mu
) and standard deviation (sigma
) of the Normal components.- X
Numeric matrix. The design matrix for the regression model (rows = observations, columns = covariates).
- y
Numeric vector. The observed responses.
- k_max
Integer. Maximum number of Poisson events to consider for truncation in likelihood approximation (default is 10).
Value
A numeric value giving the negative log-likelihood. Returns
Inf
if invalid parameters are provided or numerical issues occur.