R/safeLog.R

Defines functions `safeLog`

`safeLog` <-
function(x) {
    G.THRESH.LOG      <-  1e-200; ## threshold used to avoid numerical problem
    x[x < G.THRESH.LOG]    <- G.THRESH.LOG;
    x[x > 1./G.THRESH.LOG] <- 1./G.THRESH.LOG;
    log(x);
}

Try the vbmp package in your browser

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

vbmp documentation built on Nov. 8, 2020, 5:38 p.m.