
log(2*(pnorm(x))
and its derivatives,
including inverse Mills ratio.zeta(k, x)
NA
s) and Inf
s are allowedk
-th order derivative evaluated at x
k
between 0 and 5, the derivative of order k
of log(2*pnorm(x))
is evaluated; the derivative of
order k=0
refers to the function itself.
If k
is not integer, it is converted to integer and a warning
message is generated.
If k<0< code=""> or k>5
, NULL
is returned. The computation for k>1
is reduced to the case k=1
, making use
of expressions given by Azzalini and Capitanio (1999). For numerical
stability, the evaluation of zeta(1,x)
when x < -50
makes use
of the asymptotic expansion (26.2.13) in Abramowitz and Stegun (1964).
zeta(1,-x)
equals dnorm(x)/pnorm(-x)
(in principle, apart from
the asymptotic expansion mentioned above), called the
inverse Mills ratio.
Azzalini, A. and Capitanio, A. (1999).
Statistical applications of the multivariate skew-normal distribution.
Technical report available at
y <- zeta(2,seq(-20,20,by=0.5))
#
for(k in 0:5) curve(zeta(k,x), from=-1.5, to=5, col = k+2, add = k > 0)
legend(3.5, -0.5, legend=as.character(0:5), col=2:7, lty=1)
Run the code above in your browser using DataLab