Skip to content

Formulas for Stable Calculation of Log Prob #4

Description

@TheAeryan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions