npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
sampleDistro1DWithWeight.hh File Reference

Acceptance-rejection sampling from a density with compensatory weights. Does not change the average but affects the variance. More...

#include <cmath>
#include <vector>
#include <utility>
#include <cassert>
#include <stdexcept>
#include <climits>
#include "npstat/nm/Triple.hh"
#include "npstat/nm/fcnOrConst.hh"
#include "npstat/rng/AbsRandomGenerator.hh"
#include "npstat/stat/AbsDistribution1D.hh"

Go to the source code of this file.

Namespaces

 npstat
 

Enumerations

enum  SampleSizeInterpretation { SIZE_IS_N_TRIES = 0 , SIZE_IS_N_GENERATED , SIZE_IS_KISHS }
 

Functions

template<class AcceptanceFunction >
npstat::Triple< double, double, double > npstat::sampleDistro1DWithWeight (const AbsDistribution1D &distro, const AcceptanceFunction &fcn, AbsRandomGenerator &rng, const double sampleSize, const SampleSizeInterpretation whichSize, std::vector< std::pair< double, double > > *sample)
 

Detailed Description

Acceptance-rejection sampling from a density with compensatory weights. Does not change the average but affects the variance.

Author: I. Volobouev

June 2022