R/rnorm.trunc.R

rnorm.trunc <-
function (n, mu, sigma, lo=-Inf, hi=Inf){
  # Calculates truncated noraml
  p.lo = pnorm (lo, mu, sigma)
  p.hi = pnorm (hi, mu, sigma)
  u = runif (n, p.lo, p.hi)
  return (qnorm (u, mu, sigma))
}
kuppal2/xmsPANDA documentation built on May 15, 2021, 5:48 a.m.