5 #ifndef BPP_NUMERIC_PROB_MIXTUREOFDISCRETEDISTRIBUTIONS_H 6 #define BPP_NUMERIC_PROB_MIXTUREOFDISCRETEDISTRIBUTIONS_H 39 std::vector<std::unique_ptr<DiscreteDistributionInterface>>
vdd_;
54 MixtureOfDiscreteDistributions(
const std::vector<std::unique_ptr<DiscreteDistributionInterface>>& distributions,
const std::vector<double>& probas);
65 std::string
getName()
const {
return "Mixture"; }
104 double qProb(
double x)
const;
106 double pProb(
double x)
const;
122 #endif // BPP_NUMERIC_PROB_MIXTUREOFDISCRETEDISTRIBUTIONS_H MixtureOfDiscreteDistributions & operator=(const MixtureOfDiscreteDistributions &mdd)
double getNProbability(size_t n) const
Returns the probability of the n-th discrete distribution in the mixture.
virtual ~MixtureOfDiscreteDistributions()
void setNumberOfCategories(size_t nbClasses)
sets the number of categories of EACH submodel to nbClasses, so the number of categories of the mixtu...
Partial implementation of the DiscreteDistribution interface.
The constraint interface.
void setNamespace(const std::string &prefix)
Set the namespace for the parameter names.
void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
double pProb(double x) const
Return the cumulative quantile of the continuous version of the distribution, ie .
double Expectation(double a) const
Return a primitive function used for the expectation of the continuous version of the distribution...
double qProb(double x) const
Return the quantile of the continuous version of the distribution, ie y such that ...
void updateDistribution()
Interface for discrete distribution objects.
const DiscreteDistributionInterface & nDistribution(size_t n) const
Returns a pointer to the n-th discrete distribution in the mixture.
A Discrete distribution object defined by a vector of Discrete Distributions and a set of probabiliti...
The parameter list object.
void restrictToConstraint(const ConstraintInterface &c)
Restricts the distribution to the domain where the constraint is respected, in addition of other pred...
size_t getNumberOfDistributions() const
Returns the number of discrete distributions in the mixture.
std::string getName() const
Get the name of the distribution.
MixtureOfDiscreteDistributions(const std::vector< std::unique_ptr< DiscreteDistributionInterface >> &distributions, const std::vector< double > &probas)
Builds a new MixtureOfDiscreteDistributions object from a vector of Discrete Distributions and a vect...
void setMedian(bool median)
Sets the median value to true to say that the value in a class is proportional to the median value of...
MixtureOfDiscreteDistributions * clone() const
Create a copy of this object and send a pointer to it.
void discretize()
Discretizes the distribution in equiprobable classes.
std::vector< double > probas_
std::vector< std::unique_ptr< DiscreteDistributionInterface > > vdd_
std::vector< std::string > vNestedPrefix_