1 #ifndef NPSTAT_TWODISTROS1DFUNCTORS_HH_
2 #define NPSTAT_TWODISTROS1DFUNCTORS_HH_
28 inline virtual double operator()(
const double& x)
const
30 if (x < 0.0 || x > 1.0)
33 return altPtr_->cdf(nullPtr_->quantile(x)) - x;
47 inline virtual double operator()(
const double& x)
const
49 if (x < 0.0 || x > 1.0)
53 const double y = nullPtr_->quantile(x);
54 const double nulldens = nullPtr_->density(y);
55 if (nulldens <= 0.0)
throw std::runtime_error(
56 "In npstat::ComparisonDensityFunctor1D::operator(): "
57 "baseline density is not positive");
58 return altPtr_->density(y)/nulldens;
84 double trigCoeff(
unsigned k,
bool isCosine,
unsigned nInteg)
const;
93 double cosCoeff(
unsigned k,
unsigned nInteg)
const;
97 inline std::vector<double>
98 legendreSeriesCoeffs2(
const unsigned maxDeg)
const
100 std::vector<double> tmp(maxDeg+1U);
A base class for functors used to study GoF tests.
Definition: AbsTwoDistros1DFunctor.hh:21
Definition: TwoDistros1DFunctors.hh:20
Definition: TwoDistros1DFunctors.hh:38
double legendreCoeff(unsigned degree) const
double trigCoeff(unsigned k, bool isCosine, unsigned nInteg) const
void legendreSeriesCoeffs(double *coeffs, unsigned maxDeg) const
double cosCoeff(unsigned k, unsigned nInteg) const
Definition: AbsArrayProjector.hh:14
Definition: AbsDistribution1D.hh:31