Learn R Programming

gplm (version 0.7-4)

glm.ll: Log-likelihood for GLM

Description

Calculates the log-likelihood function of a GLM. Currently only the gaussian and the bernoulli family are implemented.

Usage

glm.ll(mu, y, phi=1, family="gaussian", k=1)

Arguments

mu
n x 1, predicted regression function
y
n x 1, responses
phi
scalar, nuisance parameter (sigma^2 for the gaussian and inverse gaussian families, nu for the gamma family)
family
text string, family of distributions (e.g. "gaussian" or "bernoulli", see details below)
k
integer > 0, parameter for the negative binomial

Value

log-likelihood value

Details

Implemented are the "gaussian" family (with links "identity" and "log"), the "bernoulli" family (with links "logit" and "probit"), the "gamma" family (with link "inverse"), the "poisson" family (with link "log"), the "inverse.gaussian" family (with link "inverse.squared") and the "negative.binomial" (with its canonical "log" type link).

The default value k=1 leads to the geometric distribution (as a special case of the negative binomial).

See Also

glm.lld, glm.link

Examples

Run this code
  glm.ll(rep(0.4,2), c(0,1), family="bernoulli")

Run the code above in your browser using DataLab