R/math.R

Defines functions logit logistic anti_phred phred log_sum_exp

logit <- function(x) {
	log(x) - log(1 - x)
}

logistic <- function(x) {
	1 / (1 + exp(-x))	
}

anti_phred <- function(x) {
	10^(-x/10)
}

phred <- function(x) {
	-10 * log10(x)
}

log_sum_exp <- function(x) {
	x.max <- max(x);
	log(sum(exp(x - x.max))) + x.max
}
djhshih/orient-bias-filter documentation built on Nov. 4, 2019, 10:54 a.m.