llmnl {bayesm}R Documentation

Evaluate Log Likelihood for Multinomial Logit Model

Description

llmnl evaluates log-likelihood for the multinomial logit model.

Usage

llmnl(beta, y, X)

Arguments

beta

kx1k x 1 coefficient vector

y

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

X

npxkn*p x k design matrix (use createX to create XX)

Details

Let μi=Xibeta\mu_i = X_i beta, then Pr(yi=j)=exp(μi,j)/kexp(μi,k)Pr(y_i=j) = exp(\mu_{i,j}) / \sum_k exp(\mu_{i,k}).
XiX_i is the submatrix of XX corresponding to the iith observation. XX has npn*p rows.

Use createX to create XX.

Value

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

Warning

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

Author(s)

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

References

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

See Also

createX, rmnlIndepMetrop

Examples

## Not run: ll=llmnl(beta,y,X)

[Package bayesm version 3.1-6 Index]