R/my_dlaplace.R

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 BlockFeST package in your browser

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

BlockFeST documentation built on March 15, 2021, 9:07 a.m.