[R] Derivative of the probit

2010-05-06 Thread Andrew Redd
Is there a function to compute the derivative of the probit (qnorm) function
in R, or in any of the packages?

Thanks,
-Andrew

[[alternative HTML version deleted]]

__
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.


Re: [R] Derivative of the probit

2010-05-06 Thread Thomas Stewart
f-function(x) 1/dnorm(qnorm(x))
for x in (0,1)

-tgs

On Thu, May 6, 2010 at 4:40 PM, Andrew Redd ar...@stat.tamu.edu wrote:

 Is there a function to compute the derivative of the probit (qnorm)
 function
 in R, or in any of the packages?

 Thanks,
 -Andrew

[[alternative HTML version deleted]]

 __
 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.


[[alternative HTML version deleted]]

__
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.


Re: [R] Derivative of the probit

2010-05-06 Thread Ted Harding
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.