docs: add runnable integral relative entropy example - #1903
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks @Artamta. The example is well-formed and runs, but reviewing it surfaced an accuracy problem in the function itself that I don't want to put front-and-center in the rendered docs. For
So this isn't a coarse-approximation artifact; the estimate converges to the wrong number on a trivial diagonal case. A docstring example is the first thing a user runs, so I'd rather not ship one whose printed value is visibly ~9% off from a result the reader can compute by hand. Holding this until the underlying accuracy issue is resolved (that's a separate fix, not something to paper over here). Once the function returns a faithful value, this example is a good addition. Nothing wrong with your PR mechanically. |
|
@vprusso I came across this PR, and I took a look into the integral relative entropy implementation. I think the issue is in the mu/lambda generator. It was setting the lower bound mu to 1/lambda, which for small lambda was overestimating the grid lower bound, leading to too small values. Opened a fix in #1904, let me know what you think |
|
The underlying accuracy bug is now fixed on master (#1904, thanks to @simsaidan): |
Description
Adds a runnable example for
evaluate_relative_entropy_integralas part of #1886.Changes
Checklist
rufffor errors related to code style and formatting.pytest.Testing performed
0.1194.ruff checkpassed.ruff format --checkpassed.git diff --checkpassed.