R/dhypoexp.R

Defines functions dhypoexp

Documented in dhypoexp

dhypoexp <- function(x, rate = 1.0, log = FALSE) {
    stopifnot(is.numeric(x),
              all(is.finite(rate)),
              is.logical(log))

    res <- drop(tcrossprod(outer(X   = x,
                                 Y   = rate,
                                 FUN = dexp,
                                 log = FALSE),
                           t(ratetoalpha(rate))))

    if (log) {
        return(log(res))
    } else {
        return(res)
    }
}

Try the sdprisk package in your browser

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

sdprisk documentation built on May 1, 2019, 7:50 p.m.