Re: Assign a generic name to a function based on user decision
- From: Jason Blevins <jrblevin@xxxxxxxxxxxxxxxx>
- Date: Tue, 02 Jun 2009 17:23:29 -0400
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/
.
- Follow-Ups:
- References:
- Assign a generic name to a function based on user decision
- From: Lurkos
- Re: Assign a generic name to a function based on user decision
- From: nmm1
- Re: Assign a generic name to a function based on user decision
- From: e p chandler
- Re: Assign a generic name to a function based on user decision
- From: Jason Blevins
- Re: Assign a generic name to a function based on user decision
- From: nmm1
- Assign a generic name to a function based on user decision
- Prev by Date: Re: Assign a generic name to a function based on user decision
- Next by Date: Re: Coarrays: procedure execution image
- Previous by thread: Re: Assign a generic name to a function based on user decision
- Next by thread: Re: Assign a generic name to a function based on user decision
- Index(es):
Relevant Pages
|