R/truncgamma3.R

truncgamma3 <-
function (n = 1, p, shape, scale, l, u) 
{
    l1 <- pgamma(l, shape, scale = scale)
    u1 <- pgamma(u, shape, scale = scale)
    x <- dunif(p, l1, u1)
    if (x == 0) {
        y = u
    }
    else {
        if (x == 1) {
            y = l
        }
        else {
            y = qgamma(p = x, shape = shape, scale = scale)
        }
    }
    return(y)
}

Try the HSROC package in your browser

Any scripts or data that you put into this service are public.

HSROC documentation built on Sept. 19, 2019, 9:05 a.m.