|
Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
|
Importance sampling mean estimator with variance reduction. More...
#include <ISMeanEstimator.hpp>
Public Member Functions | |
| ImportanceEstimate< dim > | estimate (const mc::domains::IntegrationDomain< dim > &domain, std::uint32_t seed, std::size_t n_samples, const mc::proposals::Proposal< dim > &proposal, const std::function< double(const mc::geom::Point< dim > &)> &f) const |
| Estimate the weighted mean using importance sampling. | |
Importance sampling mean estimator with variance reduction.
| dim | Dimensionality of the space. |
Estimates the mean using importance sampling:
Variance Reduction: If q(x) ≈ f(x), the weights [f(x)/q(x)] are roughly constant, reducing variance compared to uniform sampling.
Usage: For integration over Ω: ∫_Ω f(x) dx ≈ (mean result) [no volume factor—importance weight handles normalization]
Definition at line 59 of file ISMeanEstimator.hpp.
| ImportanceEstimate< dim > mc::estimators::ISMeanEstimator< dim >::estimate | ( | const mc::domains::IntegrationDomain< dim > & | domain, |
| std::uint32_t | seed, | ||
| std::size_t | n_samples, | ||
| const mc::proposals::Proposal< dim > & | proposal, | ||
| const std::function< double(const mc::geom::Point< dim > &)> & | f | ||
| ) | const |
Estimate the weighted mean using importance sampling.
| domain | The integration domain. |
| seed | Random seed for reproducibility. |
| n_samples | Number of samples to draw from proposal. |
| proposal | Sampling distribution q(x) (should resemble |f(x)|). |
| f | Function to evaluate. |
| std::invalid_argument | if n_samples == 0. |
Algorithm: