Internal function, logdiff
logdiff(x, y)
x | numeric |
---|---|
y | numeric |
max(x) + log(exp(x - max(x,y)) - exp(y-max(x,y)))
This function calculates the log of the difference of the exponentiated logs taking out the max, i.e. insuring that the difference is not negative
ie you want log(exp(x) - exp(y))
#> [1] 6.907755 6.907755 6.907755 6.907755 6.907755 6.907755 6.907755 6.907755 #> [9] 6.907755 6.907755#> [1] 6.907755 6.907755 6.907755 6.907755 6.907755 6.907755 6.907755 6.907755 #> [9] 6.907755 6.907755