40 #ifndef _DISCRETEDISTRIBUTION_H_ 41 #define _DISCRETEDISTRIBUTION_H_ 43 #include "../VectorTools.h" 44 #include "../ParameterAliasable.h" 45 #include "../NumConstants.h" 46 #include "../../Exceptions.h" 47 #include "../../Io/OutputStream.h" 76 #ifndef NO_VIRTUAL_COV 87 virtual std::string
getName()
const = 0;
116 virtual double getCategory(
size_t categoryIndex)
const = 0;
150 virtual void set(
double category,
double probability) = 0;
163 virtual void add(
double category,
double probability) = 0;
194 virtual double rand()
const = 0;
212 virtual
double qProb(
double x) const = 0;
220 virtual
double pProb(
double x) const = 0;
261 virtual
double getBound(
size_t) const = 0;
321 #endif //_DISCRETEDISTRIBUTION_H_ virtual double getSSupCumulativeProbability(double category) const =0
virtual double getInfCumulativeProbability(double category) const =0
virtual double pProb(double x) const =0
Return the cumulative quantile of the continuous version of the distribution, ie .
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
Extend the Parametrizable interface with support for parameter aliases.
This class allows to perform a correspondence analysis.
Interface for discrete distribution objects.
virtual bool strictLowerBound() const
virtual double getProbability(size_t categoryIndex) const =0
virtual double getLowerBound() const
methods about the range of the definition
virtual void add(double category, double probability)=0
Modify the probability associated to a class.
virtual Vdouble getCategories() const =0
virtual double getCategory(size_t categoryIndex) const =0
virtual double getIInfCumulativeProbability(double category) const =0
virtual double rand() const =0
Draw a random number from this distribution.
virtual void discretize()=0
Discretizes the distribution in equiprobable classes.
The constraint interface.
std::vector< double > Vdouble
virtual std::string getName() const =0
Get the name of the distribution.
virtual double qProb(double x) const =0
Return the quantile of the continuous version of the distribution, ie y such that ...
virtual double getUpperBound() const
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...
virtual void setNumberOfCategories(size_t nbClasses)=0
sets the number of categories and discretizes if there is a change in this number.
virtual ~DiscreteDistribution()
virtual double getBound(size_t) const =0
virtual double getSupCumulativeProbability(double category) const =0
virtual double randC() const =0
Draw a random number from the continuous version of this distribution, if it exists.
virtual Vdouble getProbabilities() const =0
virtual Vdouble getBounds() const =0
DiscreteDistribution * clone() const =0
Create a copy of this object and send a pointer to it.
virtual double getValueCategory(double value) const =0
virtual void print(OutputStream &out) const =0
Print the distribution (categories and corresponding probabilities) to a stream.
virtual bool strictUpperBound() const
virtual void restrictToConstraint(const Constraint &c)=0
Restricts the distribution to the domain where the constraint is respected, in addition of other pred...