BUG: `laplace.inverse_cdf()` is not correct.
WarrenWeckesser opened this issue · comments
Warren Weckesser commented
The implementation of the inverse_cdf()
method for the Laplace distribution is missing calls to ln()
.
The following
statrs/src/distribution/laplace.rs
Lines 127 to 131 in 435739b
should be
if p <= 0.5 {
self.location + self.scale * (2. * p).ln()
} else {
self.location - self.scale * (2. - 2. * p).ln()
}
(See, for example, the entry for Quantile in the table on the right in the Laplace distribution wikipedia page.)
I'll submit a pull request with a fix.