[pstricks] inverse standard normal

Michael Sharpe msharpe at ucsd.edu
Fri Sep 24 00:23:36 CEST 2010

On Sep 23, 2010, at 2:59 AM, Matthias Ruess wrote:

> Hi, 
> I need to draw the density function of the Vasicek distribution: This density function has the following structure: 
> a * Exp[ (b * norminv(x) + c)^2 + d * norminv(x)^2  ] where a,b,c and d are constants. 
> Since there exist an Exp-operator in pstricks, the only thing I need is a norminv operator (an approximation of the inverse of the standard normal distribution). 
> Is there someone who can help me to build this in pstricks? 

Based on Abramowitz-Stegun, formula 26.2.23, you can approximate the inverse stndard normal using the code

\pstVerb{ /c0 2.515517 def /c1 .802853 def /c2 .010328 def /d1 1.432788 def /d2 .189269 def /d3 .001308 def /inversenl {neg 1 add 1 exch div ln 2 mul sqrt /t exch def /t2 t dup mul def /t3 t2 t mul def c0 c1 t mul add c2 t2 mul add 1 d1 t mul add d2 t2 mul add d3 t3 mul add div neg t add} def }
\psplot[plotpoints=200]{.01}{.99}{x inversenl exec}

(The approximation is correct to 3 decimal places except very close to 0 and 1.)


More information about the PSTricks mailing list