Re: Assign a generic name to a function based on user decision



On Jun 2, 2009, at 4:35 PM, nmm1@xxxxxxxxx wrote:
In article <877hzu5ris.fsf@xxxxxxxxxxxxxxx>,
Jason Blevins <jrblevin@xxxxxxxxxxxxxxxx> wrote:

I think what Nick is getting at is that ERF only allows you to
approximate the CDF of the Gaussian distribution, but not the inverse
CDF.

Well, actually, there ARE ways to use it for that! I should have
to search the dusty attic of my mind to remember the details.

The CDF approximation is straightforward, following from the definition
of ERF (and being an approximation to the extent that ERF is an
approximation of the error function):

PHI(x) = 1/2 * [ 1 + ERF(x / SQRT(2)) ]

If anyone happens to know the details of an inverse CDF approximation,
I'd be curious to see it!

For that, you need a different approximation such as the one here:

http://home.online.no/~pjacklam/notes/invnorm/

My main point was that you should NOT do that. Unless that function
is exceptionally good, the results will be unsuitable for many uses
and the function will be slow. Once upon a time, I could have told
you a dozen good methods off the top of my head. The best simple
one is the polar (rejection) method - do NOT use the Box-Mueller one.

Agreed. I should have noted that I wasn't recommending this for use in
generating random numbers, only if you need the inverse CDF for whatever
reason (quantiles, etc.). For draws, I use the polar method.

--
Jason Blevins
Ph.D. Candidate, Department of Economics, Duke University
http://jblevins.org/
.



Relevant Pages

  • Re: normal distribution pdfs and cdf: speed and accuracy
    ... In the marginal likelihood calculation, I compute a lot of normpdf's currently using the Lightspeed package. ... Delta * normpdf. ... It IS more accurate to use the cdf here. ... the cdf is a better approximation than your ...
    (comp.soft-sys.matlab)
  • Re: Bounding the beta function
    ... variable from the beta distribution with mean 0.5 and variance ... Normal cdf as N)). ... Is this approximation an application ...
    (sci.math)
  • Re: erf function in C
    ... > probability) as part of their math libraries? ... * guarantee the error is less than one ulp for erf. ... we use rational approximation to approximate ... * Coefficients for approximation to erf in ...
    (comp.lang.c)
  • Re: Assign a generic name to a function based on user decision
    ... distribution by using ERF on ones with a uniform one lacks Clue. ... Do you object to applying an approximation to the inverse Gaussian CDF ...
    (comp.lang.fortran)
  • Re: Assign a generic name to a function based on user decision
    ... The CDF approximation is straightforward, ... of ERF (and being an approximation to the extent that ERF is an ... the error function! ...
    (comp.lang.fortran)