mc_valor_promedio_1d
Estimate a definite integral with the mean-value Monte Carlo method and return the result, confidence interval, and sample statistics.
Instructions
Estimate ∫ₐᵇ f(x) dx with the mean-value Monte Carlo method.
Args: func_str: Math expression in x. a, b: Integration limits (b > a). N: Number of samples. seed: Optional RNG seed for reproducibility. precision: Rounding digits. nivel_confianza: Confidence level in (0, 1). plot: When True, also return a PNG scatter plot of the samples.
Returns:
Dict with the estimate, confidence interval and sample statistics.
With plot=True a list [dict, Image] is returned instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| N | No | ||
| a | Yes | ||
| b | Yes | ||
| plot | No | ||
| seed | No | ||
| func_str | Yes | ||
| precision | No | ||
| nivel_confianza | No |