# st: Multinomial logit-type probability in log likelihood for ML model

 From Bob Hammond To statalist@hsphsun2.harvard.edu Subject st: Multinomial logit-type probability in log likelihood for ML model Date Sat, 01 Sep 2007 12:25:11 -0500

All,

I am having trouble coding an ML program for my log likelihood function. I'll simplify several aspects of the log likelihood that seem unrelated to my question. Define `lnf' for an individual observation as follows:

replace `lnf' = (Binomial(n,j,q) - Binomial(n,j+1,q)) * f(x) if \$ML_y1 == 1

In words, the probability that Y is 1 is the probability of observing exactly j successes out of n (where q is the probability of a success on an individual trial) times some function f(x). The probability q takes a multinomial logit form:

q_i = exp(X_i * `theta') / (1 + sum(exp(X_h * `theta')))

where the sum goes from h=1, ..., J, so it sums the product of the covariate vector X times the parameter vector `theta' for all observations in the data set.
It seems that I need some way to construct the summation in the denominator of q first, but my confusion is that this denominator contains the `theta' parameter vector. Basically, for every observation in the data set, I need to construct a scalar that multiplies the 1 x k covariate vector X by the k x 1 parameter vector `theta' that needs to be estimated. Then I need to sum these J scalars up (call this a, which is a function of `theta'). If I could do that, then, after constructing a, I would write:

replace `lnf' = (Binomial(n,j, exp(`theta') / (1 + a) - Binomial(n,j, exp(`theta') / (1 + a)) * f(x)
if \$ML_y1 == 1

I don't know how to construct "a" because it contains the parameter vector `theta'. I've tried taking a look at the ado file for mlogit, but didn't find the answer. Thanks in advance,

Bob
--
------------------------------------------------------------------------
Bob Hammond
Department of Economics
Vanderbilt University
http://people.vanderbilt.edu/~robert.g.hammond/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/