Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
ISMeanEstimator.hpp
Go to the documentation of this file.
1
12#ifndef MONTECARLO_DGL_ISMEANESTIMATOR_HPP
13#define MONTECARLO_DGL_ISMEANESTIMATOR_HPP
14
15#include <cstddef>
16#include <cstdint>
17#include <functional>
18
19namespace mc::estimators {
20
26template <std::size_t dim>
29 double mean = 0.0;
31 double stderr = 0.0;
33 std::size_t n_samples = 0;
35 std::size_t n_inside = 0;
36};
37
58template <std::size_t dim>
60public:
78 std::uint32_t seed,
79 std::size_t n_samples,
80 const mc::proposals::Proposal<dim>& proposal,
81 const std::function<double(const mc::geom::Point<dim>&)>& f) const;
82};
83
84} // namespace mc::estimators
85
86#include "ISMeanEstimator.tpp"
87
88#endif // MONTECARLO_DGL_ISMEANESTIMATOR_HPP
Abstract base class for N-dimensional integration domains.
Importance sampling mean estimator with variance reduction.
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.
N-dimensional point representation.
Definition geometry.hpp:32
Abstract proposal distribution interface.
Definition proposal.hpp:29
Result of importance sampling mean estimation.
std::size_t n_samples
Total samples generated from proposal.
std::size_t n_inside
Samples that fell inside domain (and had q > 0).
double mean
Estimated importance-weighted mean: μ̂ = (1/N) ∑ [f(xᵢ)/q(xᵢ)].
double stderr
Standard error of the weighted mean.