Re: Assign a generic name to a function based on user decision
- From: nmm1@xxxxxxxxx
- Date: Tue, 2 Jun 2009 22:49:51 +0100 (BST)
In article <87oct649f2.fsf@xxxxxxxxxxxxxxx>,
Jason Blevins <jrblevin@xxxxxxxxxxxxxxxx> wrote:
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)) ]
Well, yes, except that statisticians refer to what you call PHI as
the error function! The problem is that ERF is pretty foul to
approximate.
If anyone happens to know the details of an inverse CDF approximation,
I'd be curious to see it!
Obviously, it's the inverse of the above! Seriously. That is all
that there is to it, mathematically. In practice, it is considerably
nastier, but ERF is still pretty nasty.
You approximate the inverse by breaking up the range, using the
Taylor series (or Pade approximant) near zero, the asymptotic
approximation (which isn't very good) for large results, and any
suitable hack in between.
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.
Right. You have Clue.
Regards,
Nick Maclaren.
.
- 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: Jason Blevins
- 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: Jason Blevins
- Assign a generic name to a function based on user decision
- Prev by Date: Re: Coarrays: procedure execution image
- Next by Date: Re: open syntax error with gfortran
- 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
|