[R] Derivative of the probit

(Ted Harding) Ted.Harding at manchester.ac.uk
Thu May 6 23:23:58 CEST 2010


On 06-May-10 20:40:30, Andrew Redd wrote:
> Is there a function to compute the derivative of the probit (qnorm)
> function
> in R, or in any of the packages?
> 
> Thanks,
> -Andrew

I don't think so (though stand to be corrected). However, it would
be straightforward to write one.

For simplicity of notation:
  P(x) = pnorm(x)
  Q(p) = qnrom(p)
  D(x) = dnorm(x)
  "'" stands for derivative.

Then

  P'(x) = D(x)

  P(Q(p)) = p

Differentiate w.r.to p:

  P'(Q(p))*Q'(p) = 1

  Q'(p) = 1/P'(Q(p)) = 1/D(Q(p))

Hence:

  dqnorm <- function(p){ 1/dnorm(qnorm(p)) }

(I think that's right ... )

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 06-May-10                                       Time: 22:23:53
------------------------------ XFMail ------------------------------



More information about the R-help mailing list