#2 incorrect definition of erfi

closed-fixed
nobody
None
5
2000-02-28
1999-12-15
No

Brad Holden <holden@tokyo-rose.uchicago.edu>

So, erfi() is not inverting erf(), but seems to be doing something else.

Hua Yu <hyu@ali.boltz.cs.cmu.edu>:
Recently I downloaded PDL-2.003, somehow made everything seemingly
working, except that the inverse error function
&PDL::erfi($a) seems to be a misnomer for inverse Normal CDF.
'cause what it ends up calling is ndtri().

Workaround:

Brad Holden <holden@tokyo-rose.uchicago.edu> writes:

>
> I would guess that I need to rebuild PDL not using the math library's
> version of erf to get consistency?
>

As a workaround you could make a little subroutine that
uses the inconsistent erfi to compute a consistent erfi,
lets call it cerfi:

sub cerfi { return sqrt(2)/2*erfi((1+$_[0])/2) }

perldl> p cerfi erf(0.2)
0.2

For a proper fix the definition of erfi should probably be
changed accordingly in math.pd.

Discussion

  • Robin Williams

    Robin Williams - 2000-02-28
    • status: Error - status not found --> closed-fixed
     
  • Robin Williams

    Robin Williams - 2000-02-28

    Fixed code, and one use within source (in `grandom\'). Added regression test.

     

Log in to post a comment.