Open wds15 opened 1 year ago
I happen to use on a few of my programs a specialised function called log_inv_logit which is arithmetically equal to log(inv_logit(x)).
log_inv_logit
log(inv_logit(x))
For numerical stability reasons the function is defined as:
log_inv_logit <- function(mat) { idx <- mat < 0 mat[idx] <- mat[idx] - log1p(exp(mat[idx])) mat[!idx] <- -1*log1p(exp(-mat[!idx])) mat }
The log1p function would also be great to have on its own in the usual vector/row/col flavour: log1p(x) = log(1 + x)
log1p
log1p(x) = log(1 + x)
Other than that: Great package! matrixStats made with it's logSumExp calls EMs coded in R 3x-6x faster in a package of mine.
matrixStats
logSumExp
I happen to use on a few of my programs a specialised function called
log_inv_logit
which is arithmetically equal tolog(inv_logit(x))
.For numerical stability reasons the function is defined as:
The
log1p
function would also be great to have on its own in the usual vector/row/col flavour:log1p(x) = log(1 + x)
Other than that: Great package!
matrixStats
made with it'slogSumExp
calls EMs coded in R 3x-6x faster in a package of mine.