40 #ifndef _ABSTRACTDISCRETEDISTRIBUTION_H_ 41 #define _ABSTRACTDISCRETEDISTRIBUTION_H_ 44 #include "../Constraints.h" 45 #include "../AbstractParameterAliasable.h" 164 void set(
double category,
double probability);
165 void add(
double category,
double probability);
171 double randC()
const throw (
Exception) {
throw Exception(
"AbstractDiscreteDistribution::randC. No continuous version available for this distribution."); }
245 #endif //_ABSTRACTDISCRETEDISTRIBUTION_H_
double getInfCumulativeProbability(double category) const
double getCategory(size_t categoryIndex) const
Comparator class for AbstractDiscreteDistribution.
Vdouble getBounds() const
double getLowerBound() const
Partial implementation of the DiscreteDistribution interface.
double getIInfCumulativeProbability(double category) const
bool strictLowerBound() const
An interval, either bounded or not, which can also have infinite bounds.
This class allows to perform a correspondence analysis.
Interface for discrete distribution objects.
double getSSupCumulativeProbability(double category) const
double getSupCumulativeProbability(double category) const
bool strictLowerBound() const
double getBound(size_t i) const
void add(double category, double probability)
Modify the probability associated to a class.
double randC() const
Draw a random number from the continuous version of this distribution, if it exists.
Vdouble getProbabilities() const
double getProbability(size_t categoryIndex) const
size_t getNumberOfCategories() const
AbstractDiscreteDistribution & operator=(const AbstractDiscreteDistribution &adde)
bool operator()(double l1, double l2) const
A partial implementation of the Parametrizable interface.
void print(OutputStream &out) const
Print the distribution (categories and corresponding probabilities) to a stream.
bool strictUpperBound() const
double rand() const
Draw a random number from this distribution.
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 setPrecision(double prec)
double getLowerBound() const
methods about the range of the definition
The constraint interface.
std::vector< double > Vdouble
std::map< double, double, Order > distribution_
virtual void discretize()
Discretizes the distribution in equiprobable classes.
AbstractDiscreteDistribution(size_t nbClasses, const std::string &prefix="")
virtual ~AbstractDiscreteDistribution()
double getUpperBound() const
bool strictUpperBound() const
void setNumberOfCategories(size_t nbClasses)
sets the number of categories and discretizes if there is a change in this number.
Order & operator=(const Order &ord)
double getValueCategory(double value) const
Vdouble getCategories() const
Index out of bounds exception class.
double getUpperBound() const
Order(double prec=NumConstants::TINY())
IntervalConstraint intMinMax_
the interval where the distribution is defined/restricted.
size_t numberOfCategories_
virtual void restrictToConstraint(const Constraint &c)
Restricts the distribution to the domain where the constraint is respected, in addition of other pred...
std::vector< double > bounds_