Hello everyone,

I am a beginner of STATA and want to estimate a model:

There are two firms 1 and 2, which have characteristics X1 and X2. They decide whether to enter a market or not (yi=1 means to enter and yi=0 means not), the cost of entry, if the other firm enters, is delta. So the profit of the firms are Zi=yi(Xi bi + delta y-i+ei), where ei is iid normal and e1, e2 are independent.

Now I know that the probability of both firms entering is Pr(y1=1 and y2=1) = Φ(-X1b1)Φ(−X2b2), no firm enters is Pr(y1=0 and y2=0)= (1-Φ(-X1b1-delta))*(1-Φ(-X2b2-delta) and one firm enters is 1-Pr(2)-Pr(0).
I have the data of entrance decision (y1 and y2) and X1 X2, I want to estimate b1 b2 and delta.

I write the log-likelihood function as
L =(1-y1)(1-y2)[ ln Φ(-X1b1)+lnΦ(−X2b2)] + (y1y2)[ln (1-Φ(-X1b1-delta)) + ln (1-Φ(-X2b2-delta)] +[(1-y1)y2+(1-y2)y1] {ln(1-Φ(-X1b1)Φ(−X2b2))-[(1-Φ(-X1b1-delta))*(1-Φ(-X2b2-delta]}.

This is just L = (1-y1)(1-y2) ln Pr(2) + y1y2 ln Pr(0) +[(1-y1)y2+(1-y2)y1] ln Pr(1).

However, I do not know how to estimate the MLE in STATA. A simple MLE does not work as I have two independent variables and code "mvprobit (y1=x1) (y2=x2)" does not work.
The problem is that I have three cases in the likelihood function and do not know how to write it properly.