Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: binormal approximation

From   Matthew Baker <>
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 */
V=1,0 \ 0,1
X=-9 \ -9
/* 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
downloaded and installed, and works something like the following:

/* begin example */
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
<> 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:
> *
> *
> *

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index