Skip to content

Commit

Permalink
gh-35367: Add output documentation on monte_carlo_integral
Browse files Browse the repository at this point in the history
    
This small commit adds an OUTPUT description to the documentation of
monte_carlo_integral. The wording of the output is essentially taken
from numerical_integral.

This is a nearly trivial documentation change, made after having a
conversation with someone using monte-carlo-integration and being
confused at the output. Specifically, the output is the tuple
`(approximate_integral, approximate_error_bound)`. The error bound
wasn't documented.

I will also note that this is my first direct contribution in the github
era - please let me know if there is something I should be doing here.

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.
    
URL: #35367
Reported by: David Lowry-Duda
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Apr 4, 2023
2 parents 78f152e + 82d39e3 commit f091c75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sage/calculus/integration.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,11 @@ def monte_carlo_integral(func, xl, xu, size_t calls, algorithm='plain',
* 'vegas' -- The VEGAS algorithm of Lepage is based on importance
sampling.
OUTPUT:
A tuple whose first component is the approximated integral and whose second
component is an error estimate.
EXAMPLES::
sage: x, y = SR.var('x,y')
Expand Down

0 comments on commit f091c75

Please sign in to comment.