Learn R Programming

bayesm (version 3.1-6)

llmnl: Evaluate Log Likelihood for Multinomial Logit Model

Description

llmnl evaluates log-likelihood for the multinomial logit model.

Usage

llmnl(beta, y, X)

Value

Value of log-likelihood (sum of log prob of observed multinomial outcomes).

Arguments

beta

\(k x 1\) coefficient vector

y

\(n x 1\) vector of obs on y (1,..., p)

X

\(n*p x k\) design matrix (use createX to create \(X\))

Warning

This routine is a utility routine that does not check the input arguments for proper dimensions and type.

Author

Peter Rossi, Anderson School, UCLA, perossichi@gmail.com.

Details

Let \(\mu_i = X_i beta\), then \(Pr(y_i=j) = exp(\mu_{i,j}) / \sum_k exp(\mu_{i,k})\).
\(X_i\) is the submatrix of \(X\) corresponding to the \(i\)th observation. \(X\) has \(n*p\) rows.

Use createX to create \(X\).

References

For further discussion, see Bayesian Statistics and Marketing by Rossi, Allenby, and McCulloch.

See Also

createX, rmnlIndepMetrop

Examples

Run this code
if (FALSE) ll=llmnl(beta,y,X)

Run the code above in your browser using DataLab