21#ifndef MONTECARLO_1_MIXTURE_PROPOSAL_HPP
22#define MONTECARLO_1_MIXTURE_PROPOSAL_HPP
53 std::vector<double> weights);
62 const std::vector<double>&
getWeights() const noexcept {
return w; }
65 std::vector<const Proposal<dim>*> comps;
66 std::vector<double> w;
68 mutable std::discrete_distribution<std::size_t> cat;
70 static void validateInputs(
const std::vector<
const Proposal<dim>*>& components,
71 const std::vector<double>& weights);
72 static std::vector<double> normalizeWeights(
const std::vector<double>& weights);
N-dimensional point representation.
std::size_t numComponents() const noexcept
MixtureProposal(std::vector< const Proposal< dim > * > components, std::vector< double > weights)
Construct a mixture proposal from non-owning component pointers and weights.
mc::geom::Point< dim > sample(std::mt19937 &rng) const override
Sample from the mixture.
double pdf(const mc::geom::Point< dim > &x) const override
Evaluate mixture PDF q(x) = sum_k w_k * q_k(x).
const std::vector< double > & getWeights() const noexcept
Abstract proposal distribution interface.
Abstract base for probability distributions used in importance sampling.