Displaying 1 result from an estimated 1 matches for "mdevstdev".
Did you mean:
mdev_dev
2004 May 05
4
Discontinuities in a simple graph (machine precision?)
Hi,
I've got an ugly but fairly simple function:
mdevstdev <- function(a){
l <- dnorm(a)/(1-pnorm(a))
integrand <- function(z)(abs(z-l)*dnorm(z))
inted <- integrate(integrand, a, Inf)
inted[[1]]/((1- pnorm(a))*sqrt((1 + a*l - l^2)))
}
I wanted to quickly produce a graph of this over the range [-3,3] so I
used:
plotit <-function(x=se...