densities #48
cscherrer
started this conversation in
Show and tell
Replies: 1 comment
-
Here's how it works: function logdensity(μ::AbstractMeasure, ν::AbstractMeasure, x)
bμ = basemeasure(μ)
bν = basemeasure(ν)
result = logdensity(μ,x) + logdensity(bμ,x)
result -= logdensity(ν,x) + logdensity(bν, x)
result += _logdensity(basemeasure(bμ), basemeasure(bν), x)
end The idea is that the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say we have a normal distribution,
and a Cauchy distribution
Note that the base measures here are different, because each accounts for the normalizing factor:
But we can still get density functions between them using a three-argument form I just added in
dev
:And just to check...
We might want to have the Radon-Nikodym derivative as a separate operator, so we also can do this:
Beta Was this translation helpful? Give feedback.
All reactions