Skip to content

An issue regarding to gradient

2 messages · luke1022, David Winsemius

#
The following code will get me a curve plot:
cutoff <- seq(1,7,0.25)
Sensitivity <- 1 - pnorm(cutoff, 5, 0.8)
Specificity <- pnorm(cutoff, 3, 1.2)
plot(1-Specificity,Sensitivity,main = "ROC curve",type = "o")

How do I get a gradient of a particular point on that curve?
Any packages/functions allow me to do that?  

Thank you

--
View this message in context: http://r.789695.n4.nabble.com/An-issue-regarding-to-gradient-tp3893401p3893401.html
Sent from the R help mailing list archive at Nabble.com.
#
On Oct 11, 2011, at 6:02 AM, luke1022 wrote:

            
First you need to define what you mean by "gradient at a point" when  
the gradient is discontinuous at each point. Is this a numerical  
example and you want to take the means of the slopes on either side,  
(rather like the definition of the Dirac function at x=0) ...

in whiich case these are the  slopes _between_not_at_ the points:

diff(Specificity)/diff(1-Sensitivity)

or ... is this a homework problem and you are being asked to use the  
knowledge that those (Sensitivity, Specificity) points came from  
particular pnorm functions?