5 #ifndef BPP_NUMERIC_PROB_DISCRETEDISTRIBUTION_H 6 #define BPP_NUMERIC_PROB_DISCRETEDISTRIBUTION_H 9 #include "../../Exceptions.h" 10 #include "../../Io/OutputStream.h" 11 #include "../NumConstants.h" 12 #include "../ParameterAliasable.h" 13 #include "../VectorTools.h" 49 virtual std::string
getName()
const = 0;
87 virtual double getCategory(
size_t categoryIndex)
const = 0;
121 virtual void set(
double category,
double probability) = 0;
134 virtual void add(
double category,
double probability) = 0;
165 virtual double rand()
const = 0;
175 virtual double randC()
const = 0;
183 virtual double qProb(
double x)
const = 0;
191 virtual double pProb(
double x)
const = 0;
232 virtual double getBound(
size_t)
const = 0;
291 #endif // BPP_NUMERIC_PROB_DISCRETEDISTRIBUTION_H virtual double randC() const =0
Draw a random number from the continuous version of this distribution, if it exists.
virtual void restrictToConstraint(const ConstraintInterface &c)=0
Restricts the distribution to the domain where the constraint is respected, in addition of other pred...
virtual std::string getName() const =0
Get the name of the distribution.
virtual double getValueCategory(double value) const =0
DiscreteDistributionInterface * clone() const =0
Create a copy of this object and send a pointer to it.
Extend the Parametrizable interface with support for parameter aliases.
virtual void discretize()=0
Discretizes the distribution in equiprobable classes.
virtual void setMedian(bool median)=0
Sets the median value to true to say that the value in a class is proportional to the median value of...
The constraint interface.
virtual size_t getCategoryIndex(double value) const =0
virtual Vdouble getCategories() const =0
virtual ~DiscreteDistributionInterface()
Interface for discrete distribution objects.
virtual double getUpperBound() const
virtual double getBound(size_t) const =0
virtual double getProbability(size_t categoryIndex) const =0
virtual double getInfCumulativeProbability(double category) const =0
virtual Vdouble getProbabilities() const =0
virtual void add(double category, double probability)=0
Modify the probability associated to a class.
virtual double rand() const =0
Draw a random number from this distribution.
virtual double getSupCumulativeProbability(double category) const =0
virtual double Expectation(double a) const =0
Return a primitive function used for the expectation of the continuous version of the distribution...
virtual size_t getNumberOfCategories() const =0
std::vector< double > Vdouble
virtual double getLowerBound() const
methods about the range of the definition
virtual void print(OutputStream &out) const =0
Print the distribution (categories and corresponding probabilities) to a stream.
DiscreteDistributionInterface()
virtual double pProb(double x) const =0
Return the cumulative quantile of the continuous version of the distribution, ie .
virtual double getCategory(size_t categoryIndex) const =0
virtual double qProb(double x) const =0
Return the quantile of the continuous version of the distribution, ie y such that ...
virtual bool strictUpperBound() const
virtual void setNumberOfCategories(size_t nbClasses)=0
sets the number of categories and discretizes if there is a change in this number.
virtual double getSSupCumulativeProbability(double category) const =0
virtual double getIInfCumulativeProbability(double category) const =0
virtual Vdouble getBounds() const =0
virtual bool strictLowerBound() const