# orddered probit and CML

0

Dear User,

I try to estimate an ordered probit using the CML package, however I don't get correct results (when comparing with what I actually simulate or results from stata). My llf looks like this:

```proc llf (b,X); local m; m = X*b[1:2,.]; retp( (I00 .*ln(cdfn(b[3,1]*ones(t-1,1)-m))) + (I11 .*ln(cdfn(b[4,1]*ones(t-1,1)-m)-cdfn(b[3,1]*ones(t-1,1)-m))) + (I22 .*(cdfnc(b[4,1]*ones(t-1,1)-m))) ); //log likelihood function endp; ```

with the I00,I11 etc being the proper indicators b[1:2,.] are the coefficeint and b[3,1] and b[4,1] are the cutoff points. I think the llf is correct so I'm really at a wondering why it doesn't work.

best

Oldes

0

Post the log-likelihood maximums from CML and Stata.  Sometimes CML gets a different but better result.  Of course other times there may be some other problem.  I'll check your code.

0

Thanks for the quick response, good point: I looked them up and now I'm thoroughly confused since they are very different. For CML it is: -0.27130086, for stata it is -827.73002.

Also, as already indicated, I believe stata gives the correct results (since I simulate the DGP I know what the coefficients are), while CML does not. Thanks for checking the code.

best

Oldes

0

Early versions of CML posted the mean maximum, i.e., it divides the maximum by the number of observations.  Multiply -0.27130086 for the CML maximum.

0

You log-likelihood doesn't seem right.  Try this

proc llf(b,X);

local z1,z2,z3,m;
m = X*b[1:2,.];
z1 = I00.*(cdfn(b[3,1]*ones(t-1,1)-m));
z2 = I11 .*(cdfn(b[4,1]*ones(t-1,1)-m)-cdfn(b[3,1]*ones(t-1,1)-m));
z3 = I22 .*(cdfnc(b[4,1]*ones(t-1,1)-m));

retp(ln(z1 + z2 + z3));

endp;

0

Dear Ron,

thanks, this llf together with cleaning up the code (it was an old code which I only recently worked on again) works. But I still have a question, all my Econometrics books tell me that the llf is the sum of the logs and not the logs of the sum as it is in your case. So, why did you chose to model the llf in this particular way? An answer is grreatly appreaciated.

best

Oldes

0

I'm assuming that the indicators, I00, I11, I22, are exclusive, i.e., that when there is a one in given element of one of them, the corresponding elements in the other two are zeros. When you add z1, z2, and z3 you are getting a vector of individual probabilities for each observation, and the log-likelihood is the log of those probabilities.

0

Post the log-likelihood maximums from CML and Stata.  Sometimes CML gets a different but better result.  Of course other times there may be some other problem.  I'll check your code.

0

Thanks for the quick response, good point: I looked them up and now I'm thoroughly confused since they are very different. For CML it is: -0.27130086, for stata it is -827.73002.

Also, as already indicated, I believe stata gives the correct results (since I simulate the DGP I know what the coefficients are), while CML does not. Thanks for checking the code.

best

Oldes

0

Early versions of CML posted the mean maximum, i.e., it divides the maximum by the number of observations.  Multiply -0.27130086 for the CML maximum.

0

You log-likelihood doesn't seem right.  Try this

proc llf(b,X);

local z1,z2,z3,m;
m = X*b[1:2,.];
z1 = I00.*(cdfn(b[3,1]*ones(t-1,1)-m));
z2 = I11 .*(cdfn(b[4,1]*ones(t-1,1)-m)-cdfn(b[3,1]*ones(t-1,1)-m));
z3 = I22 .*(cdfnc(b[4,1]*ones(t-1,1)-m));

retp(ln(z1 + z2 + z3));

endp;

0

Dear Ron,

thanks, this llf together with cleaning up the code (it was an old code which I only recently worked on again) works. But I still have a question, all my Econometrics books tell me that the llf is the sum of the logs and not the logs of the sum as it is in your case. So, why did you chose to model the llf in this particular way? An answer is grreatly appreaciated.

best

Oldes

0

I'm assuming that the indicators, I00, I11, I22, are exclusive, i.e., that when there is a one in given element of one of them, the corresponding elements in the other two are zeros. When you add z1, z2, and z3 you are getting a vector of individual probabilities for each observation, and the log-likelihood is the log of those probabilities.

• ### Aptech Systems, Inc. Worldwide Headquarters

Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286

Phone: 360.886.7100
FAX: 360.886.8922

• ### Training & Events

Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.

• ### Tutorials

Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.

• ### Want to find out more?

Get a real answer from a real person

• ### Have a Specific Question?

Get a real answer from a real person

• Need Support?
• ### Support Plans

Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.

• ### User Forums

Join our community to see why our users are considered some of the most active and helpful in the industry!