mc_hit_or_miss_1d
Estimate definite integrals of sign-changing functions using hit-or-miss Monte Carlo sampling, returning the signed integral with confidence interval and sample statistics.
Instructions
Estimate ∫ₐᵇ f(x) dx with the hit-or-miss Monte Carlo method.
Handles sign-changing integrands correctly (returns the signed integral).
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) for the interval.
Returns: Dict with the estimate, interval, sample statistics and history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| N | No | ||
| a | Yes | ||
| b | Yes | ||
| seed | No | ||
| func_str | Yes | ||
| precision | No | ||
| nivel_confianza | No |