[R] Inverse Error Function

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Mon Jun 26 21:44:46 CEST 2006



Nathan Dabney wrote:
> Do any of the R libraries have an implementation of the Inverse Error
> Function (Inverse ERF)?
> 
> ref:
> http://mathworld.wolfram.com/InverseErf.html
> http://functions.wolfram.com/GammaBetaErf/InverseErf/
> 
> Thanks,
> Nathan
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Don't know of a built-in function, but you can try this:

## if you want the so-called 'error function'
## from ?pnorm
erf <- function(x) 2 * pnorm(x * sqrt(2)) - 1
erf.inv <- function(x) qnorm((x + 1)/2)/sqrt(2)

erf.inv(1)
erf.inv(0)
erf.inv(-1)
erf.inv(erf(.25))
erf(erf.inv(.25))
erf.inv(.5)

HTH,

--sundar



More information about the R-help mailing list