Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

llmnl

Evaluate Log Likelihood for Multinomial Logit Model


Description

llmnl evaluates log-likelihood for the multinomial logit model.

Usage

llmnl(beta, y, X)

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)

Details

Let μ_i = X_i beta, then Pr(y_i=j) = exp(μ_{i,j}) / ∑_k exp(μ_{i,k}).
X_i is the submatrix of X corresponding to the ith observation. X has n*p rows.

Use createX to create X.

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.
http://www.perossi.org/home/bsm-1

See Also

Examples

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

bayesm

Bayesian Inference for Marketing/Micro-Econometrics

v3.1-4
GPL (>= 2)
Authors
Peter Rossi <perossichi@gmail.com>
Initial release
2019-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.