likmultinom: Multinomial Log Likelihood Function

Description Usage Arguments Details Value Examples

Description

The log likelihood of a multinomial density with data, x, size and prob parameters.

Usage

1
likmultinom(x, size = NULL, prob, log = TRUE)

Arguments

x

vector of length K of integers in 0:size.

size

integer, say N, specifying the total number of objects that are put into K boxes in the typical multinomial experiment. For dmultinom, it defaults to sum(x).

prob

numeric non-negative vector of length K, specifying the probability for the K classes; is internally normalized to sum 1. Infinite and missing values are not allowed.

log

logical; if TRUE, log probabilities are computed.

Details

The log likelihood is the log of a function of parameters given the data.

Value

A numeric scalar for the log likelihood of the multinomial density given the data where size and prob can be held constant or if vector were given vector will be returned.

Examples

1
2
likmultinom(x = rmultinom(n = 2, size = 3, prob = .4),
        size = 3, prob = .4)

likelihoodExplore documentation built on May 1, 2019, 10:21 p.m.