41 #ifndef BPP_NUMERIC_PROB_MIXTUREOFDISCRETEDISTRIBUTIONS_H
42 #define BPP_NUMERIC_PROB_MIXTUREOFDISCRETEDISTRIBUTIONS_H
75 std::vector<DiscreteDistribution*>
vdd_;
105 std::string
getName()
const {
return "Mixture"; }
145 double qProb(
double x)
const;
147 double pProb(
double x)
const;
Partial implementation of the DiscreteDistribution interface.
The constraint interface.
Interface for discrete distribution objects.
A Discrete distribution object defined by a vector of Discrete Distributions and a set of probabiliti...
void updateDistribution()
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...
void restrictToConstraint(const Constraint &c)
Restricts the distribution to the domain where the constraint is respected, in addition of other pred...
double getNProbability(size_t n) const
Returns the probability of the n-th discrete distribution in the mixture.
std::vector< DiscreteDistribution * > vdd_
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 discretize()
Discretizes the distribution in equiprobable classes.
MixtureOfDiscreteDistributions * clone() const
Create a copy of this object and send a pointer to it.
std::string getName() const
Get the name of the distribution.
size_t getNumberOfDistributions() const
Returns the number of discrete distributions in the mixture.
MixtureOfDiscreteDistributions(const std::vector< DiscreteDistribution * > &distributions, const std::vector< double > &probas)
Builds a new MixtureOfDiscreteDistributions object from a vector of Discrete Distributions and a vect...
~MixtureOfDiscreteDistributions()
std::vector< double > probas_
std::vector< std::string > vNestedPrefix_
MixtureOfDiscreteDistributions & operator=(const MixtureOfDiscreteDistributions &mdd)
const DiscreteDistribution * getNDistribution(size_t n) const
Returns a pointer to the n-th discrete distribution in the mixture.
double pProb(double x) const
Return the cumulative quantile of the continuous version of the distribution, ie .
void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
void setNamespace(const std::string &prefix)
Set the namespace for the parameter names.
void setNumberOfCategories(size_t nbClasses)
sets the number of categories of EACH submodel to nbClasses, so the number of categories of the mixtu...
The parameter list object.