 Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: binormal approximation

 From Matthew Baker To statalist@hsphsun2.harvard.edu Subject Re: st: binormal approximation Date Wed, 2 Nov 2011 10:24:58 -0400

```One possibility is to use some method for evaluation of probabilities
that relies on the ghk simulator. It overcomes the problem because it
ultimately relies on univariate normal probabilities, and, hence, the
normal function to compute probabilities, as the article by Robert
Gates in the 2nd Quarter 2006 issue of the Stata Journal describes. In
mata, one would do something like the following (using 100 draws to
simulate the probability):

/* Begin example */
clear*
mata
S=ghk_init(100)
V=1,0 \ 0,1
X=-9 \ -9
ghk(S,X,V)
normal(-9)*normal(-9)
end
/* End example */

As it should in this case, the ghk(S,X,V) command returns the exact
same answer as the normal(-9)*normal(-9) command.

The same issue of the Stata journal has a piece by Cappellari and
Jenkins that presents some Stata routines for estimating multivariate
probabilities by simulation. This requires the package "mdraws" to be

/* begin example */
clear*
set obs 1
gen x1=-9
gen x2=-9
mat V=(1,0) \ (0,1)
mat CV=cholesky(V)
mdraws, draws(100) neq(2) prefix(d)
egen prob=mvnp(x1 x2), chol(CV) prefix(d)
list prob
/* end example */
and prob should contain the simulated probability. Note that one has
to do the cholesky decomposition of the variance-covariance matrix and
pass it along to the simulator in this case.

Hope that helps!

Matt Baker

--
Dr. Matthew J. Baker
Department of Economics
Hunter College and the Graduate Center, CUNY

On Wed, Nov 2, 2011 at 7:13 AM, Valerie Orozco
<Valerie.Orozco@toulouse.inra.fr> wrote:
> Hi,
>
> I have some troubles concerning approximation of normal and binormal (in a ML program).  See this little example :
>
> Even if :  binormal(-9,-9,0) = normal(-9)*normal(-9)
>
> In Stata :
>
> . di binormal(-9,-9,0)
> 0
>
> . di normal(-9)*normal(-9)
> 1.274e-38
>
> It seems that the « binormal » command has an approximation problem. And, as I take the logarithm of the value, I have a missing value when using the binormal. The problem is that I need the joint cumulative distribution of the bivariate normal because I have some correlation (that is r >0 in binormal(h,k,r)).
>
> Does someone have an idea of rewriting the binormal in order to avoid the missing problem ?
>
> Thank you.
>
> -------------------------------
> Valérie OROZCO
> Toulouse School of Economics (INRA-GREMAQ)
> 21, allée de Brienne
> F-31000 Toulouse, France
>
> MF 219
> +33 5 61 12 85 91
> -------------------------------
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```