R/my_dlaplace.R

Defines functions my_dlaplace

my_dlaplace <-function (x, location = 0, scale = 1, log = FALSE) 
{
    if (!is.logical(log.arg <- log) || length(log) != 1) 
        stop("bad input for argument 'log'")
    rm(log)
    logdensity <- (-abs(x - location)/scale) - log(2 * scale)
    if (log.arg) 
        logdensity
    else exp(logdensity)
}

Try the GeneFeST package in your browser

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

GeneFeST documentation built on May 29, 2017, 7:49 p.m.