Learn R Programming

estimators (version 0.7.3)

ll: Log-Likelihood

Description

These functions calculate the log-likelihood of an IID sample for specific values of the distribution parameters. See Details.

Usage

ll(x, prm, distr, ...)

# S4 method for ANY,ANY,character ll(x, prm, distr, ...)

llbeta(x, shape1, shape2)

# S4 method for numeric,numeric,Beta ll(x, prm, distr)

llbinom(x, size, prob)

# S4 method for numeric,numeric,Binom ll(x, prm, distr)

lldirich(x, shape, mar = 2)

# S4 method for matrix,numeric,Dirichlet ll(x, prm, distr, mar = 2)

llexp(x, rate)

# S4 method for numeric,numeric,Exp ll(x, prm, distr)

llgamma(x, shape, scale)

# S4 method for numeric,numeric,Gammad ll(x, prm, distr)

llmgamma(x, shape, scale, mar = 2)

# S4 method for matrix,numeric,MGamma ll(x, prm, distr, mar = 2)

llnorm(x, mean, sd)

# S4 method for numeric,numeric,Norm ll(x, prm, distr)

llpois(x, lambda)

# S4 method for numeric,numeric,Pois ll(x, prm, distr)

Value

Numeric. The value of the log-likelihood function.

Arguments

x

numeric. A sample under estimation.

prm

numeric. A vector of the distribution parameters.

distr

A subclass of Distribution. The distribution family assumed.

...

extra arguments.

shape1, shape2, size, prob, shape, rate, scale, mean, sd, lambda

numeric. Distribution parameters.

mar

numeric. In univariate distributions, a matrix can be given instead of a vector. In this case, the apply function is utilized and mar is passed to the MARGIN argument. If each sample is a row, set mar = 1, if it is a column, set mar = 2 (the default).

Details

The log-likelihood functions are provided in two forms: the ll<name> distribution-specific version that follows the base R conventions, and the S4 generic ll that complements the distr package functionalities.