Hi,
For my current project I need a numerically-stable version of the truncated gaussian distribution in Python. I have been taking a look at the mathematical methods you detail in the file https://github.com/cossio/TruncatedNormal.jl/blob/23bfc7d0189ca6857e2e498006bbbed2a8b58be7/notes/normal.pdf for implementing the calculation of the mean and variance in a stable manner in Python.
Nonetheless, I also need a numerically stable method for calculating the log-probability of some value under the truncated gaussian (the f function you detail in the first paragraph of the PDF). Do you know how this can be done? I assume a similar method, based on Taylor expansions, could be used, but I'm not sure.
Hi,
For my current project I need a numerically-stable version of the truncated gaussian distribution in Python. I have been taking a look at the mathematical methods you detail in the file https://github.com/cossio/TruncatedNormal.jl/blob/23bfc7d0189ca6857e2e498006bbbed2a8b58be7/notes/normal.pdf for implementing the calculation of the mean and variance in a stable manner in Python.
Nonetheless, I also need a numerically stable method for calculating the log-probability of some value under the truncated gaussian (the f function you detail in the first paragraph of the PDF). Do you know how this can be done? I assume a similar method, based on Taylor expansions, could be used, but I'm not sure.