Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods for logdensity_def(::Normal, ::Normal, x) #230

Open
cscherrer opened this issue Aug 22, 2022 · 0 comments
Open

Add methods for logdensity_def(::Normal, ::Normal, x) #230

cscherrer opened this issue Aug 22, 2022 · 0 comments

Comments

@cscherrer
Copy link
Collaborator

julia> using Symbolics

julia> @variables μp σp μq σq x;

julia> logdensity_rel(Normal(μp,σp), Normal(μq,σq), x) |> simplify
(1//2)*(((x - μq) / σq)^2) - (1//2)*(((x - μp) / σp)^2)

Note that it simplifies more than this (Factor out the 1/2, then it's a difference of squares).

We can make this efficient by adding logdensity_def methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant