JuliaMath / JuliaMath/MeasureTheory.jl

Add methods for `logdensity_def(::Normal, ::Normal, x)`

Open
#230 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
401
Forks
31
PR merge metrics
No merged PRs in 30d

Description

```julia
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.