I'd like to have a J implementation of the probit function (the inverse CDF 
(aka quantile function) of the standard normal distribution.

i.e.
   probit normalcdf 1.5
1.5

According to wikipedia (<http://en.wikipedia.org/wiki/Probit>)

probit=: (%:2) * erfinv@(_1 2 p. ])

Where erfinv is the inverse error function. I know that erf is defined in the 
'~addons/stats/base/distribution.ijs' script and the wiki page 
<http://www.jsoftware.com/jwiki/Essays/Normal_CDF> as:

   erf=: (1 H. 1.5)@*: * 2p_0.5&* % ^@:*:

Can anyone provide a definition for its inverse?

In the meantime I've been able to use the recently updated Rserve interface to 
R to access its quantile function:

load 'stats/r/rserve'
NB. Start Rserve (R CMD rserve.exe)
   'p' Rset normalcdf 1.5
   Rget 'qnorm(p)'
1.5
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to