nll2: Negative log-likelihood

View source: R/nll.R

nll2R Documentation

Negative log-likelihood

Description

Negative log-likelihood

Usage

nll2(
  theta,
  dat,
  mm,
  beta,
  phi,
  inCop,
  fam_cop = 1,
  family,
  link,
  cop_pars = NULL,
  use_cpp = TRUE,
  other_pars = list()
)

Arguments

theta

concatenated vector of parameters (beta followed by phi)

dat

matrix of data

mm

model matrix for use with beta

beta

(sparse) matrix of regression parameters for each variable and copula

phi

vector of dispersion parameters

inCop

vector of integers giving variables in dat to be included in copula

fam_cop, family

integer and integer vector for copula and distribution families respectively

link

vector of link functions

cop_pars

other parameters for copula

use_cpp

logical: should Rcpp functions be used?

other_pars

other parameters to pass to glm_dens

Details

The number of columns of beta should be the number of columns in dat plus the number required to parameterize the copula. The first few columns and the entries in phi are assumed to be in the order of those in dat. If the ith family for a variable does not require a dispersion parameter then the value of phi[i] is ignored.


rje42/causl documentation built on June 1, 2025, 2:50 p.m.