Chapter 24 Logarithms in R
By Nathan Brouwer
Logging splits up multiplication into addition. So, log(m*n) is the same as log(m) + log(n)
You can check this
<-10
m<-11
nlog(m*n)
## [1] 4.70048
log(m)+log(n)
## [1] 4.70048
log(m*n) == log(m)+log(n)
## [1] TRUE
Exponentiation undos logs
exp(log(m*n))
## [1] 110
*n m
## [1] 110
The key equation in BLAST’s E values is
u = ln(Kmn)/lambda
This can be changed to
[ln(K) + ln(mn)]/lambda
We can check this
<- 1
K <- 10
m <- 11
n <- 110
lambda
log(K*m*n)/lambda
## [1] 0.04273164
log(K) + log(m*n))/lambda (
## [1] 0.04273164
log(K*m*n)/lambda == (log(K) + log(m*n))/lambda
## [1] TRUE