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.hard...@manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 06-May-10 Time: 22:23:53 ------------------------------ XFMail ------------------------------ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.