The Inverse Mills Ratio (IMR) is defined as the ratio of the standard normal density, \(\phi\), divided by the standard normal cumulative distribution function, \(\Phi\):
\[\begin{eqnarray} \operatorname{IMR}(x) = \dfrac{\phi(x)}{\Phi(x)},\,\,\, x \in {\mathbb R}. \end{eqnarray}\]This quantity appears in many statistical models such as Sample Selection models, survival analysis, principal component analysis, among others. The IMR has some interesting properties [1,2]:
# The Inverse Mills Ratio (IMR) function
IMR <- Vectorize( function(x) exp( dnorm(x,log=T) - pnorm(x,log.p = T) ) )
curve(IMR, -15, 15, n = 10000, lwd = 2, cex.axis=1.5, cex.lab=1.5, xlab="x", ylab="IMR", main = "Inverse Mills Ratio")
# -First derivative of IMR
D <- Vectorize( function(x) x*IMR(x) + IMR(x)^2 )
curve(D, -15, 15, n = 10000, lwd = 2, cex.axis=1.5, cex.lab=1.5, xlab="x", ylab="D", main = "-First Derivative of IMR")