bpp-core3  3.0.0
bpp::MixtureOfDiscreteDistributions Class Referenceabstract

A Discrete distribution object defined by a vector of Discrete Distributions and a set of probabilities for these Discrete Distributions. More...

#include <Bpp/Numeric/Prob/MixtureOfDiscreteDistributions.h>

+ Inheritance diagram for bpp::MixtureOfDiscreteDistributions:
+ Collaboration diagram for bpp::MixtureOfDiscreteDistributions:

Public Member Functions

 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 vector of probabilities. More...
 
virtual ~MixtureOfDiscreteDistributions ()
 
 MixtureOfDiscreteDistributions (const MixtureOfDiscreteDistributions &mdd)
 
MixtureOfDiscreteDistributionsoperator= (const MixtureOfDiscreteDistributions &mdd)
 
MixtureOfDiscreteDistributionsclone () const
 Create a copy of this object and send a pointer to it. More...
 
std::string getName () const
 Get the name of the distribution. More...
 
size_t getNumberOfDistributions () const
 Returns the number of discrete distributions in the mixture. More...
 
const DiscreteDistributionInterfacenDistribution (size_t n) const
 Returns a pointer to the n-th discrete distribution in the mixture. More...
 
double getNProbability (size_t n) const
 Returns the probability of the n-th discrete distribution in the mixture. More...
 
void setNumberOfCategories (size_t nbClasses)
 sets the number of categories of EACH submodel to nbClasses, so the number of categories of the mixture is the sum of all these numbers. More...
 
void fireParameterChanged (const ParameterList &parameters)
 Notify the class when one or several parameters have changed. More...
 
double qProb (double x) const
 Return the quantile of the continuous version of the distribution, ie y such that $ Prob(X<y)=x $. More...
 
double pProb (double x) const
 Return the cumulative quantile of the continuous version of the distribution, ie $ Prob(X<x) $. More...
 
double Expectation (double a) const
 Return a primitive function used for the expectation of the continuous version of the distribution, ie $ E(X|...<=X<a) = \int_{...}^a t.dProb(t) dt $. More...
 
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 the class, the proportionality factor being such that the sum of the values equals the expectation of the distribution. If it is set to false, the value is the mean value in the class. More...
 
void restrictToConstraint (const ConstraintInterface &c)
 Restricts the distribution to the domain where the constraint is respected, in addition of other predefined constraints. More...
 
void discretize ()
 Discretizes the distribution in equiprobable classes. More...
 
void setNamespace (const std::string &prefix)
 Set the namespace for the parameter names. More...
 
virtual size_t getNumberOfIndependentParameters () const =0
 Get the number of independent parameters. More...
 
size_t getNumberOfIndependentParameters () const
 Get the number of independent parameters. More...
 
virtual void aliasParameters (const std::string &p1, const std::string &p2)=0
 Set two parameters as 'aliased'. More...
 
virtual void aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose)=0
 alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden. More...
 
void aliasParameters (const std::string &p1, const std::string &p2)
 alias the parameters. More...
 
void aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose)
 alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden. More...
 
virtual void unaliasParameters (const std::string &p1, const std::string &p2)=0
 Detach two parameters previously set as 'aliased'. More...
 
void unaliasParameters (const std::string &p1, const std::string &p2)
 Detach two parameters previously set as 'aliased'. More...
 
virtual const ParameterListgetIndependentParameters () const =0
 Get the minimal list of parameters to set the model. More...
 
const ParameterListgetIndependentParameters () const
 Get the minimal list of parameters to set the model. More...
 
virtual std::vector< std::string > getAlias (const std::string &name) const =0
 
virtual std::vector< std::string > getAlias (const std::string &name) const
 
virtual std::map< std::string, std::string > getAliases () const =0
 
virtual std::map< std::string, std::string > getAliases () const
 
virtual bool hasParameter (const std::string &name) const =0
 Tell if there is a parameter with specified name. More...
 
bool hasParameter (const std::string &name) const override
 Tell if there is a parameter with specified name. More...
 
virtual const ParameterListgetParameters () const =0
 Get all parameters available. More...
 
const ParameterListgetParameters () const override
 Get all parameters available. More...
 
virtual const Parameterparameter (const std::string &name) const =0
 Get the parameter with specified name. More...
 
const Parameterparameter (const std::string &name) const override
 Get the parameter with specified name. More...
 
virtual double getParameterValue (const std::string &name) const =0
 Get the value for parameter of name 'name'. More...
 
double getParameterValue (const std::string &name) const override
 Get the value for parameter of name 'name'. More...
 
virtual void setAllParametersValues (const ParameterList &parameters)=0
 Set the parameters values to be equals to those of parameters. More...
 
void setAllParametersValues (const ParameterList &parameters) override
 Set the parameters values to be equals to those of parameters. More...
 
virtual void setParameterValue (const std::string &name, double value)=0
 Set the value of parameter with name name to be equal to value. More...
 
void setParameterValue (const std::string &name, double value) override
 Set the value of parameter with name name to be equal to value. More...
 
virtual void setParametersValues (const ParameterList &parameters)=0
 Update the parameters from parameters. More...
 
void setParametersValues (const ParameterList &parameters) override
 Update the parameters from parameters. More...
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 Update the parameters from parameters. More...
 
bool matchParametersValues (const ParameterList &parameters) override
 Update the parameters from parameters. More...
 
virtual void removeConstraint (const std::string &name)=0
 Remove the constraint associated with one parameter, if any. More...
 
void removeConstraint (const std::string &name) override
 Remove the constraint associated with one parameter, if any. More...
 
virtual void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0
 Set/Change the constraint associated with one parameter. More...
 
void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
 Set/Change the constraint associated with one parameter. More...
 
virtual size_t getNumberOfParameters () const =0
 Get the number of parameters. More...
 
size_t getNumberOfParameters () const override
 Get the number of parameters. More...
 
virtual std::string getNamespace () const =0
 
std::string getNamespace () const override
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const =0
 Resolves a parameter name according to the current namespace. More...
 
std::string getParameterNameWithoutNamespace (const std::string &name) const override
 Resolves a parameter name according to the current namespace. More...
 
bool hasIndependentParameter (const std::string &name) const
 
ParameterList getAliasedParameters (const ParameterList &pl) const
 Return the list of the names of the parameters that are aliased (directly or not) to one of the parameters of the list. More...
 
ParameterList getFromParameters (const ParameterList &pl) const
 Return the list of the names of the parameters from which the parameters of the list are aliased (directly or not). More...
 
std::string getFrom (const std::string &name) const
 
const std::shared_ptr< Parameter > & getParameter (const std::string &name) const
 
The DiscreteDistribution interface.
size_t getNumberOfCategories () const
 
double getCategory (size_t categoryIndex) const
 
double getProbability (size_t categoryIndex) const
 
double getProbability (double category) const
 
Vdouble getCategories () const
 
Vdouble getProbabilities () const
 
double getValueCategory (double value) const
 
size_t getCategoryIndex (double value) const
 
void set (double category, double probability)
 Set the probability associated to a class. More...
 
void add (double category, double probability)
 Modify the probability associated to a class. More...
 
double getInfCumulativeProbability (double category) const
 
double getIInfCumulativeProbability (double category) const
 
double getSupCumulativeProbability (double category) const
 
double getSSupCumulativeProbability (double category) const
 
double rand () const
 Draw a random number from this distribution. More...
 
double randC () const
 Draw a random number from the continuous version of this distribution, if it exists. More...
 
double getBound (size_t i) const
 
double getLowerBound () const
 methods about the range of the definition More...
 
double getUpperBound () const
 
bool strictLowerBound () const
 
bool strictUpperBound () const
 
Vdouble getBounds () const
 
void print (OutputStream &out) const
 Print the distribution (categories and corresponding probabilities) to a stream. More...
 
double precision () const
 

Static Public Attributes

static short DISCRETIZATION_EQUAL_PROB = 1
 
static short DISCRETIZATION_EQUAL_INTERVAL = 2
 
static short DISCRETIZATION_EQUAL_PROB_WHEN_POSSIBLE = 3
 

Protected Member Functions

void updateDistribution ()
 
void discretizeEqualProportions ()
 
void discretizeEqualIntervals ()
 
virtual ParameterListgetParameters_ ()=0
 Get all parameters available. More...
 
ParameterListgetParameters_ () override
 Get all parameters available. More...
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void shareParameter_ (const std::shared_ptr< Parameter > &parameter)
 
void shareParameters_ (const ParameterList &parameters)
 
void includeParameters_ (const ParameterList &parameters)
 
void deleteParameter_ (size_t index)
 
void deleteParameter_ (std::string &name)
 
void deleteParameters_ (const std::vector< std::string > &names)
 
void resetParameters_ ()
 
const std::shared_ptr< Parameter > & getParameter (size_t i) const
 
std::shared_ptr< Parameter > & getParameter (size_t i)
 
ParametergetParameter_ (const std::string &name)
 
ParametergetParameter_ (size_t index)
 
const ParametergetParameter_ (size_t index) const
 
ParametergetParameterWithNamespace_ (const std::string &name)
 
const ParametergetParameterWithNamespace_ (const std::string &name) const
 

Protected Attributes

std::vector< std::unique_ptr< DiscreteDistributionInterface > > vdd_
 
std::vector< double > probas_
 
std::vector< std::string > vNestedPrefix_
 
size_t numberOfCategories_
 
std::map< double, double, Orderdistribution_
 
std::vector< double > bounds_
 
std::shared_ptr< IntervalConstraintintMinMax_
 the interval where the distribution is defined/restricted. More...
 
bool median_
 
short discretizationScheme_
 

Detailed Description

A Discrete distribution object defined by a vector of Discrete Distributions and a set of probabilities for these Discrete Distributions.

The non-null values of the MixtureOfDiscreteDistributions are all the non-null values of the Discrete Distributions, with probabilities equal to their probabilities in each Discrete Distribution multiplied by the specific probability of this Distribution.

Parameters:

For the probabilities: they are called "theta1",... and defined as $ \theta_{i \in 1..\textrm{size-1}} $ such that probability of value $i $ is $ (1-\theta_1).(1-\theta_2)...\theta_{i} $

For the values: they are the parameters of the Discrete Distributions, prefixed by the index in the vector of the Discrete Distributions.

Definition at line 35 of file MixtureOfDiscreteDistributions.h.

Constructor & Destructor Documentation

◆ MixtureOfDiscreteDistributions() [1/2]

MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions ( const std::vector< std::unique_ptr< DiscreteDistributionInterface >> &  distributions,
const std::vector< double > &  probas 
)

◆ ~MixtureOfDiscreteDistributions()

MixtureOfDiscreteDistributions::~MixtureOfDiscreteDistributions ( )
virtual

Definition at line 106 of file MixtureOfDiscreteDistributions.cpp.

References vdd_.

◆ MixtureOfDiscreteDistributions() [2/2]

MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions ( const MixtureOfDiscreteDistributions mdd)

Definition at line 75 of file MixtureOfDiscreteDistributions.cpp.

References probas_, vdd_, and vNestedPrefix_.

Member Function Documentation

◆ add()

void AbstractDiscreteDistribution::add ( double  category,
double  probability 
)
virtualinherited

Modify the probability associated to a class.

If the category does not exist, a new category is created with the corresponding probability. if the category exists, add 'probability' to the existing probability. The sum of all probabilities is not checked.

Parameters
categoryThe class value.
probabilityThe class probability.

Implements bpp::DiscreteDistributionInterface.

Definition at line 151 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::distribution_.

Referenced by bpp::AbstractDiscreteDistribution::~AbstractDiscreteDistribution().

◆ addParameter_()

◆ addParameters_()

◆ aliasParameters() [1/4]

virtual void bpp::ParameterAliasable::aliasParameters ( const std::string &  p1,
const std::string &  p2 
)
pure virtualinherited

Set two parameters as 'aliased'.

The values of the two parameters will be synchronized, so that setting the value of one parameter will automatically set the value of the other one accordingly.

Parameters
p1Original parameter.
p2Aliased parameter.
Exceptions
ParameterNotFoundExceptionif p1 or p2 do not correspond to existing parameters.
Exceptionwhen trying to perform non-valid association.

Implemented in bpp::AbstractParameterAliasable.

Referenced by bpp::ParameterAliasable::~ParameterAliasable().

◆ aliasParameters() [2/4]

virtual void bpp::ParameterAliasable::aliasParameters ( std::map< std::string, std::string > &  unparsedParams,
bool  verbose 
)
pure virtualinherited

alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden.

Parameters
unparsedParamsthe map of the links : <A,B> matches for A->B aliasing.
verboseverbosity

Implemented in bpp::AbstractParameterAliasable.

◆ aliasParameters() [3/4]

◆ aliasParameters() [4/4]

void AbstractParameterAliasable::aliasParameters ( std::map< std::string, std::string > &  unparsedParams,
bool  verbose 
)
virtualinherited

alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden.

Parameters
unparsedParamsthe map of the links : <A,B> matches for A->B aliasing.
verboseverbosity

Implements bpp::ParameterAliasable.

Definition at line 120 of file AbstractParameterAliasable.cpp.

References bpp::ParameterList::addParameter(), bpp::AbstractParameterAliasable::aliasParameters(), bpp::ParameterList::clone(), bpp::Parameter::clone(), bpp::ApplicationTools::displayResult(), bpp::AbstractParametrizable::getParameters(), bpp::Parameter::getValue(), bpp::ParameterList::hasParameter(), bpp::AbstractParametrizable::matchParametersValues(), bpp::ParameterList::parameter(), bpp::ParameterList::size(), and bpp::TextTools::toString().

◆ clone()

MixtureOfDiscreteDistributions* bpp::MixtureOfDiscreteDistributions::clone ( ) const
inlinevirtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implements bpp::DiscreteDistributionInterface.

Definition at line 62 of file MixtureOfDiscreteDistributions.h.

References MixtureOfDiscreteDistributions().

Referenced by MixtureOfDiscreteDistributions().

◆ deleteParameter_() [1/2]

void bpp::AbstractParameterAliasable::deleteParameter_ ( size_t  index)
inlineprotectedvirtualinherited

◆ deleteParameter_() [2/2]

void bpp::AbstractParameterAliasable::deleteParameter_ ( std::string &  name)
inlineprotectedvirtualinherited

◆ deleteParameters_()

void bpp::AbstractParameterAliasable::deleteParameters_ ( const std::vector< std::string > &  names)
inlineprotectedvirtualinherited

Reimplemented from bpp::AbstractParametrizable.

Definition at line 252 of file AbstractParameterAliasable.h.

◆ discretize()

void MixtureOfDiscreteDistributions::discretize ( )
virtual

Discretizes the distribution in equiprobable classes.

Reimplemented from bpp::AbstractDiscreteDistribution.

Definition at line 220 of file MixtureOfDiscreteDistributions.cpp.

References updateDistribution(), and vdd_.

Referenced by getNProbability().

◆ discretizeEqualIntervals()

◆ discretizeEqualProportions()

◆ Expectation()

double MixtureOfDiscreteDistributions::Expectation ( double  a) const
virtual

Return a primitive function used for the expectation of the continuous version of the distribution, ie $ E(X|...<=X<a) = \int_{...}^a t.dProb(t) dt $.

Implements bpp::DiscreteDistributionInterface.

Definition at line 246 of file MixtureOfDiscreteDistributions.cpp.

References probas_, and vdd_.

Referenced by getNProbability().

◆ fireParameterChanged()

void MixtureOfDiscreteDistributions::fireParameterChanged ( const ParameterList parameters)
virtual

Notify the class when one or several parameters have changed.

Parameters
parametersA ParameterList object with parameters that changed.

Reimplemented from bpp::AbstractParametrizable.

Definition at line 122 of file MixtureOfDiscreteDistributions.cpp.

References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::getParameterValue(), probas_, bpp::TextTools::toString(), updateDistribution(), and vdd_.

Referenced by getNProbability().

◆ getAlias() [1/2]

virtual std::vector<std::string> bpp::ParameterAliasable::getAlias ( const std::string &  name) const
pure virtualinherited
Returns
The list of names of the parameters that are aliased with a given parameter. Depending on the implementation, the function may be recursive or not...
Parameters
nameThe name of the parameter to look for.

Implemented in bpp::AbstractParameterAliasable.

Referenced by bpp::ParametrizableCollection< N >::addObject(), bpp::BppOParametrizableFormat::write(), and bpp::ParameterAliasable::~ParameterAliasable().

◆ getAlias() [2/2]

vector< string > AbstractParameterAliasable::getAlias ( const std::string &  name) const
virtualinherited
Returns
The list of names of the parameters that are aliased with a given parameter. The implementation is recursive, which means that in the case of A->B->C, getalias(C) will return both A and B.
Parameters
nameThe name of the parameter to look for.

Implements bpp::ParameterAliasable.

Definition at line 204 of file AbstractParameterAliasable.cpp.

References bpp::AbstractParameterAliasable::aliasListenersRegister_, and bpp::VectorTools::append().

Referenced by bpp::AbstractParameterAliasable::getAliases(), and bpp::ParametrizableCollection< N >::removeObject().

◆ getAliasedParameters()

ParameterList AbstractParameterAliasable::getAliasedParameters ( const ParameterList pl) const
inherited

Return the list of the names of the parameters that are aliased (directly or not) to one of the parameters of the list.

Definition at line 244 of file AbstractParameterAliasable.cpp.

References bpp::ParameterList::addParameter(), bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::ParameterList::hasParameter(), and bpp::AbstractParametrizable::parameter().

◆ getAliases() [1/2]

virtual std::map<std::string, std::string> bpp::ParameterAliasable::getAliases ( ) const
pure virtualinherited
Returns
the map of the aliases.

Implemented in bpp::AbstractParameterAliasable.

Referenced by bpp::ParameterAliasable::~ParameterAliasable().

◆ getAliases() [2/2]

std::map< std::string, std::string > AbstractParameterAliasable::getAliases ( ) const
virtualinherited

◆ getBound()

double bpp::AbstractDiscreteDistribution::getBound ( size_t  ) const
inlinevirtualinherited
Returns
the i th internal bound

Implements bpp::DiscreteDistributionInterface.

Definition at line 141 of file AbstractDiscreteDistribution.h.

Referenced by bpp::AbstractDiscreteDistribution::getBounds().

◆ getBounds()

◆ getCategories()

Vdouble AbstractDiscreteDistribution::getCategories ( ) const
virtualinherited

◆ getCategory()

double AbstractDiscreteDistribution::getCategory ( size_t  categoryIndex) const
virtualinherited
Parameters
categoryIndexClass index.
Returns
The value associated to a given class.

Implements bpp::DiscreteDistributionInterface.

Definition at line 81 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::distribution_.

Referenced by bpp::AbstractDiscreteDistribution::~AbstractDiscreteDistribution().

◆ getCategoryIndex()

size_t AbstractDiscreteDistribution::getCategoryIndex ( double  value) const
virtualinherited
Parameters
value
Returns
The index of the category the value is in. Throws a OutOfRangeException if the value is off the domain of the DiscreteDistribution.

Implements bpp::DiscreteDistributionInterface.

Definition at line 278 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::bounds_, bpp::AbstractDiscreteDistribution::intMinMax_, and bpp::TextTools::toString().

Referenced by bpp::AbstractDiscreteDistribution::~AbstractDiscreteDistribution().

◆ getFrom()

string AbstractParameterAliasable::getFrom ( const std::string &  name) const
inherited
Returns
The name of the parameter from which a given parameter is aliased.
Parameters
nameThe name of the parameter to look for.

Definition at line 280 of file AbstractParameterAliasable.cpp.

References bpp::AbstractParameterAliasable::aliasListenersRegister_.

◆ getFromParameters()

ParameterList AbstractParameterAliasable::getFromParameters ( const ParameterList pl) const
inherited

Return the list of the names of the parameters from which the parameters of the list are aliased (directly or not).

Definition at line 297 of file AbstractParameterAliasable.cpp.

References bpp::ParameterList::addParameter(), bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::ParameterList::hasParameter(), and bpp::AbstractParametrizable::parameter().

◆ getIInfCumulativeProbability()

double AbstractDiscreteDistribution::getIInfCumulativeProbability ( double  category) const
virtualinherited

◆ getIndependentParameters() [1/2]

virtual const ParameterList& bpp::ParameterAliasable::getIndependentParameters ( ) const
pure virtualinherited

Get the minimal list of parameters to set the model.

If no parameters are aliased, this is the same a getParameters().

Returns
A minimal set of parameters.

Implemented in bpp::AbstractParameterAliasable.

Referenced by bpp::BppODiscreteDistributionFormat::initialize_(), bpp::BppOParametrizableFormat::write(), bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution(), and bpp::ParameterAliasable::~ParameterAliasable().

◆ getIndependentParameters() [2/2]

const ParameterList& bpp::AbstractParameterAliasable::getIndependentParameters ( ) const
inlinevirtualinherited

Get the minimal list of parameters to set the model.

If no parameters are aliased, this is the same a getParameters().

Returns
A minimal set of parameters.

Implements bpp::ParameterAliasable.

Definition at line 135 of file AbstractParameterAliasable.h.

◆ getInfCumulativeProbability()

double AbstractDiscreteDistribution::getInfCumulativeProbability ( double  category) const
virtualinherited

◆ getLowerBound()

double bpp::AbstractDiscreteDistribution::getLowerBound ( ) const
inlinevirtualinherited

◆ getName()

std::string bpp::MixtureOfDiscreteDistributions::getName ( ) const
inlinevirtual

Get the name of the distribution.

Returns
The name of this distribution.

Implements bpp::DiscreteDistributionInterface.

Definition at line 65 of file MixtureOfDiscreteDistributions.h.

◆ getNamespace() [1/2]

std::string bpp::AbstractParametrizable::getNamespace ( ) const
inlineoverridevirtualinherited

◆ getNamespace() [2/2]

virtual std::string bpp::Parametrizable::getNamespace ( ) const
pure virtualinherited
Returns
The current namespace used. This is an empty string if no namespace is currently defined.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ getNProbability()

double bpp::MixtureOfDiscreteDistributions::getNProbability ( size_t  n) const
inline

Returns the probability of the n-th discrete distribution in the mixture.

Parameters
nthe number of the distribution in the mixture;

Definition at line 88 of file MixtureOfDiscreteDistributions.h.

References discretize(), Expectation(), fireParameterChanged(), pProb(), qProb(), restrictToConstraint(), setMedian(), setNamespace(), setNumberOfCategories(), and updateDistribution().

◆ getNumberOfCategories()

size_t AbstractDiscreteDistribution::getNumberOfCategories ( ) const
virtualinherited

◆ getNumberOfDistributions()

size_t bpp::MixtureOfDiscreteDistributions::getNumberOfDistributions ( ) const
inline

Returns the number of discrete distributions in the mixture.

Definition at line 71 of file MixtureOfDiscreteDistributions.h.

Referenced by bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution().

◆ getNumberOfIndependentParameters() [1/2]

virtual size_t bpp::ParameterAliasable::getNumberOfIndependentParameters ( ) const
pure virtualinherited

Get the number of independent parameters.

Returns
The number of independent parameters. If no parameters are aliased, this is equivalent to the getNumberOfParameters() method.

Implemented in bpp::AbstractParameterAliasable.

Referenced by bpp::ParameterAliasable::~ParameterAliasable().

◆ getNumberOfIndependentParameters() [2/2]

size_t bpp::AbstractParameterAliasable::getNumberOfIndependentParameters ( ) const
inlinevirtualinherited

Get the number of independent parameters.

Returns
The number of independent parameters. If no parameters are aliased, this is equivalent to the getNumberOfParameters() method.

Implements bpp::ParameterAliasable.

Definition at line 137 of file AbstractParameterAliasable.h.

References bpp::AliasParameterListener::getAlias(), bpp::AliasParameterListener::getFrom(), and bpp::ParameterList::size().

◆ getNumberOfParameters() [1/2]

◆ getNumberOfParameters() [2/2]

virtual size_t bpp::Parametrizable::getNumberOfParameters ( ) const
pure virtualinherited

Get the number of parameters.

See also
getNumberOfIndependentParameters If some parameters are aliased.
Returns
The number of parameters.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::AbstractParametrizable, and bpp::DirectionFunction.

Referenced by bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution(), and bpp::Parametrizable::~Parametrizable().

◆ getParameter() [1/3]

const std::shared_ptr<Parameter>& bpp::AbstractParametrizable::getParameter ( const std::string &  name) const
inlineinherited

◆ getParameter() [2/3]

const std::shared_ptr<Parameter>& bpp::AbstractParametrizable::getParameter ( size_t  i) const
inlineprotectedinherited
Returns
The shared_ptr parameter at a given position.
Warning
No check is performed on the validity of the index given as input!

Definition at line 211 of file AbstractParametrizable.h.

References bpp::ParameterList::getParameter().

◆ getParameter() [3/3]

std::shared_ptr<Parameter>& bpp::AbstractParametrizable::getParameter ( size_t  i)
inlineprotectedinherited

Definition at line 216 of file AbstractParametrizable.h.

References bpp::ParameterList::getParameter().

◆ getParameter_() [1/3]

◆ getParameter_() [2/3]

Parameter& bpp::AbstractParametrizable::getParameter_ ( size_t  index)
inlineprotectedinherited

Definition at line 190 of file AbstractParametrizable.h.

References bpp::ParameterList::size().

◆ getParameter_() [3/3]

const Parameter& bpp::AbstractParametrizable::getParameter_ ( size_t  index) const
inlineprotectedinherited

Definition at line 197 of file AbstractParametrizable.h.

References bpp::ParameterList::size().

◆ getParameterNameWithoutNamespace() [1/2]

std::string AbstractParametrizable::getParameterNameWithoutNamespace ( const std::string &  name) const
overridevirtualinherited

Resolves a parameter name according to the current namespace.

Returns
The parameter name without the namespace prefix, if any.

Implements bpp::Parametrizable.

Definition at line 28 of file AbstractParametrizable.cpp.

References bpp::TextTools::startsWith().

Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParametrizable::getNamespace(), and bpp::AbstractParameterAliasable::operator=().

◆ getParameterNameWithoutNamespace() [2/2]

virtual std::string bpp::Parametrizable::getParameterNameWithoutNamespace ( const std::string &  name) const
pure virtualinherited

Resolves a parameter name according to the current namespace.

Returns
The parameter name without the namespace prefix, if any.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), bpp::BppOParametrizableFormat::write(), and bpp::Parametrizable::~Parametrizable().

◆ getParameters() [1/2]

const ParameterList& bpp::AbstractParametrizable::getParameters ( ) const
inlineoverridevirtualinherited

Get all parameters available.

See also
getIndependentParameters if some parameters are aliased.
Returns
A list with all parameters available.

Implements bpp::Parametrizable.

Definition at line 41 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::parameters_.

Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::FullHmmTransitionMatrix::FullHmmTransitionMatrix(), MixtureOfDiscreteDistributions(), and bpp::ParametrizableCollection< N >::removeObject().

◆ getParameters() [2/2]

virtual const ParameterList& bpp::Parametrizable::getParameters ( ) const
pure virtualinherited

◆ getParameters_() [1/2]

virtual ParameterList& bpp::Parametrizable::getParameters_ ( )
protectedpure virtualinherited

Get all parameters available.

See also
getIndependentParameters if some parameters are aliased.
Returns
A list with all parameters available.

Implemented in bpp::FunctionWrapper, bpp::AbstractParametrizable, and bpp::DirectionFunction.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ getParameters_() [2/2]

ParameterList& bpp::AbstractParametrizable::getParameters_ ( )
inlineoverrideprotectedvirtualinherited

Get all parameters available.

See also
getIndependentParameters if some parameters are aliased.
Returns
A list with all parameters available.

Implements bpp::Parametrizable.

Definition at line 205 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::parameters_.

Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParameterAliasable::aliasParameters(), and bpp::AbstractParameterAliasable::operator=().

◆ getParameterValue() [1/2]

◆ getParameterValue() [2/2]

virtual double bpp::Parametrizable::getParameterValue ( const std::string &  name) const
pure virtualinherited

Get the value for parameter of name 'name'.

Parameters
nameThe name of the parameter.
Returns
the value of parameter name.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), and bpp::Parametrizable::~Parametrizable().

◆ getParameterWithNamespace_() [1/2]

Parameter& bpp::AbstractParametrizable::getParameterWithNamespace_ ( const std::string &  name)
inlineprotectedinherited
Parameters
nameThe name of the parameter, including its namespace.
Returns
A reference toward the corresponding parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter with that name is found in the list.

Definition at line 176 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::getParameter_().

◆ getParameterWithNamespace_() [2/2]

const Parameter& bpp::AbstractParametrizable::getParameterWithNamespace_ ( const std::string &  name) const
inlineprotectedinherited
Parameters
nameThe name of the parameter, including its namespace.
Returns
A reference toward the corresponding parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter with that name is found in the list.

Definition at line 185 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::parameter().

◆ getProbabilities()

Vdouble AbstractDiscreteDistribution::getProbabilities ( ) const
virtualinherited

◆ getProbability() [1/2]

double AbstractDiscreteDistribution::getProbability ( size_t  categoryIndex) const
virtualinherited
Parameters
categoryIndexClass index.
Returns
The probability associated to a given class.

Implements bpp::DiscreteDistributionInterface.

Definition at line 93 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::distribution_.

Referenced by bpp::AbstractDiscreteDistribution::~AbstractDiscreteDistribution().

◆ getProbability() [2/2]

double AbstractDiscreteDistribution::getProbability ( double  category) const
virtualinherited
Parameters
categoryThe value associated to the class.
Returns
The probability associated to a given class.

Implements bpp::DiscreteDistributionInterface.

Definition at line 105 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::distribution_.

◆ getSSupCumulativeProbability()

double AbstractDiscreteDistribution::getSSupCumulativeProbability ( double  category) const
virtualinherited

◆ getSupCumulativeProbability()

double AbstractDiscreteDistribution::getSupCumulativeProbability ( double  category) const
virtualinherited

◆ getUpperBound()

double bpp::AbstractDiscreteDistribution::getUpperBound ( ) const
inlinevirtualinherited

◆ getValueCategory()

double AbstractDiscreteDistribution::getValueCategory ( double  value) const
virtualinherited
Parameters
value
Returns
The value of the category the value is in. Throws a OutOfRangeException if the value is off the domain of the DiscreteDistribution.

Implements bpp::DiscreteDistributionInterface.

Definition at line 259 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::bounds_, bpp::AbstractDiscreteDistribution::distribution_, bpp::AbstractDiscreteDistribution::intMinMax_, and bpp::TextTools::toString().

Referenced by bpp::AbstractDiscreteDistribution::~AbstractDiscreteDistribution().

◆ hasIndependentParameter()

bool bpp::AbstractParameterAliasable::hasIndependentParameter ( const std::string &  name) const
inlineinherited

Definition at line 133 of file AbstractParameterAliasable.h.

References bpp::ParameterList::hasParameter().

◆ hasParameter() [1/2]

virtual bool bpp::Parametrizable::hasParameter ( const std::string &  name) const
pure virtualinherited

Tell if there is a parameter with specified name.

Parameters
nameThe name of the parameter to look for.
Returns
y/n.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ hasParameter() [2/2]

bool bpp::AbstractParametrizable::hasParameter ( const std::string &  name) const
inlineoverridevirtualinherited

Tell if there is a parameter with specified name.

Parameters
nameThe name of the parameter to look for.
Returns
y/n.

Implements bpp::Parametrizable.

Definition at line 39 of file AbstractParametrizable.h.

References bpp::ParameterList::hasParameter().

Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::AbstractParametrizable::getParameter_(), and bpp::AbstractParameterAliasable::unaliasParameters().

◆ includeParameters_()

void bpp::AbstractParameterAliasable::includeParameters_ ( const ParameterList parameters)
inlineprotectedvirtualinherited

◆ matchParametersValues() [1/2]

bool bpp::AbstractParametrizable::matchParametersValues ( const ParameterList parameters)
inlineoverridevirtualinherited

Update the parameters from parameters.

Only common parameters with parameters will be updated.

Parameters
parametersA list of parameters.
Returns
True if at least one parameter value has been changed.
Exceptions
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implements bpp::Parametrizable.

Definition at line 76 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), and bpp::ParameterList::shareSubList().

Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::Simplex::setFrequencies(), bpp::ReparametrizationFunctionWrapper::setParameters(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().

◆ matchParametersValues() [2/2]

virtual bool bpp::Parametrizable::matchParametersValues ( const ParameterList parameters)
pure virtualinherited

Update the parameters from parameters.

Only common parameters with parameters will be updated.

Parameters
parametersA list of parameters.
Returns
True if at least one parameter value has been changed.
Exceptions
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::BppODiscreteDistributionFormat::initialize_(), bpp::TestFunction::setParameters(), and bpp::Parametrizable::~Parametrizable().

◆ nDistribution()

const DiscreteDistributionInterface& bpp::MixtureOfDiscreteDistributions::nDistribution ( size_t  n) const
inline

Returns a pointer to the n-th discrete distribution in the mixture.

Parameters
ntne number of the distribution in the mixture;

Definition at line 78 of file MixtureOfDiscreteDistributions.h.

◆ operator=()

MixtureOfDiscreteDistributions & MixtureOfDiscreteDistributions::operator= ( const MixtureOfDiscreteDistributions mdd)

◆ parameter() [1/2]

const Parameter& bpp::AbstractParametrizable::parameter ( const std::string &  name) const
inlineoverridevirtualinherited

◆ parameter() [2/2]

virtual const Parameter& bpp::Parametrizable::parameter ( const std::string &  name) const
pure virtualinherited

Get the parameter with specified name.

Parameters
nameThe name of the parameter to look for.
Returns
The parameter with given name.
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::TestFunction::getValue(), and bpp::Parametrizable::~Parametrizable().

◆ pProb()

double MixtureOfDiscreteDistributions::pProb ( double  x) const
virtual

Return the cumulative quantile of the continuous version of the distribution, ie $ Prob(X<x) $.

Implements bpp::DiscreteDistributionInterface.

Definition at line 230 of file MixtureOfDiscreteDistributions.cpp.

References probas_, and vdd_.

Referenced by getNProbability().

◆ precision()

◆ print()

void AbstractDiscreteDistribution::print ( OutputStream out) const
virtualinherited

Print the distribution (categories and corresponding probabilities) to a stream.

Parameters
outThe outstream where to print the distribution.

Implements bpp::DiscreteDistributionInterface.

Definition at line 249 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::distribution_.

Referenced by bpp::AbstractDiscreteDistribution::strictUpperBound().

◆ qProb()

double MixtureOfDiscreteDistributions::qProb ( double  x) const
virtual

Return the quantile of the continuous version of the distribution, ie y such that $ Prob(X<y)=x $.

Implements bpp::DiscreteDistributionInterface.

Definition at line 240 of file MixtureOfDiscreteDistributions.cpp.

Referenced by getNProbability().

◆ rand()

double AbstractDiscreteDistribution::rand ( ) const
virtualinherited

Draw a random number from this distribution.

This number will be one of the class values, drawn according to the class probabilities.

Returns
A random number according to this distribution.

Implements bpp::DiscreteDistributionInterface.

Definition at line 167 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::distribution_, and bpp::RandomTools::giveRandomNumberBetweenZeroAndEntry().

Referenced by bpp::AbstractDiscreteDistribution::~AbstractDiscreteDistribution().

◆ randC()

double bpp::AbstractDiscreteDistribution::randC ( ) const
inlinevirtualinherited

Draw a random number from the continuous version of this distribution, if it exists.

Uses the continuous version of this distribution to draw a random number.

Returns
A random number according to this distribution.
Exceptions
ExceptionIf there is no continuous version of this distribution.

Implements bpp::DiscreteDistributionInterface.

Reimplemented in bpp::TruncatedExponentialDiscreteDistribution, bpp::GammaDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::GaussianDiscreteDistribution, bpp::UniformDiscreteDistribution, and bpp::ConstantDistribution.

Definition at line 135 of file AbstractDiscreteDistribution.h.

◆ removeConstraint() [1/2]

void bpp::AbstractParametrizable::removeConstraint ( const std::string &  name)
inlineoverridevirtualinherited

Remove the constraint associated with one parameter, if any.

Parameters
nameThe name of the parameter to look for.
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implements bpp::Parametrizable.

Definition at line 85 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::getParameter_(), and bpp::Parameter::removeConstraint().

◆ removeConstraint() [2/2]

virtual void bpp::Parametrizable::removeConstraint ( const std::string &  name)
pure virtualinherited

Remove the constraint associated with one parameter, if any.

Parameters
nameThe name of the parameter to look for.
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ resetParameters_()

void bpp::AbstractParameterAliasable::resetParameters_ ( )
inlineprotectedinherited

◆ restrictToConstraint()

void MixtureOfDiscreteDistributions::restrictToConstraint ( const ConstraintInterface c)
virtual

Restricts the distribution to the domain where the constraint is respected, in addition of other predefined constraints.

Parameters
cThe Constraint to respect.

Reimplemented from bpp::AbstractDiscreteDistribution.

Definition at line 256 of file MixtureOfDiscreteDistributions.cpp.

References updateDistribution(), and vdd_.

Referenced by getNProbability().

◆ set()

void AbstractDiscreteDistribution::set ( double  category,
double  probability 
)
virtualinherited

Set the probability associated to a class.

If the category does not exist, a new category is created with the corresponding probability. If the category already exist, its probability is set to 'probability'. The sum of all probabilities is not checked.

Parameters
categoryThe class value.
probabilityThe class probability.

Implements bpp::DiscreteDistributionInterface.

Definition at line 144 of file AbstractDiscreteDistribution.cpp.

References bpp::AbstractDiscreteDistribution::distribution_.

◆ setAllParametersValues() [1/2]

void bpp::AbstractParametrizable::setAllParametersValues ( const ParameterList parameters)
inlineoverridevirtualinherited

Set the parameters values to be equals to those of parameters.

The list must contain exactly the same parameters (ie same names) than the parameters available.

Parameters
parametersA list with all parameters.
Exceptions
ParameterNotFoundExceptionIf a some parameter in the list is not in params.
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implements bpp::Parametrizable.

Definition at line 58 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::fireParameterChanged(), and bpp::ParameterList::setAllParametersValues().

◆ setAllParametersValues() [2/2]

virtual void bpp::Parametrizable::setAllParametersValues ( const ParameterList parameters)
pure virtualinherited

Set the parameters values to be equals to those of parameters.

The list must contain exactly the same parameters (ie same names) than the parameters available.

Parameters
parametersA list with all parameters.
Exceptions
ParameterNotFoundExceptionIf a some parameter in the list is not in params.
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ setConstraint() [1/2]

void bpp::AbstractParametrizable::setConstraint ( const std::string &  name,
std::shared_ptr< ConstraintInterface constraint 
)
inlineoverridevirtualinherited

Set/Change the constraint associated with one parameter.

Parameters
nameThe name of the parameter to look for.
constraintA pointer to the constraint (may be null)
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implements bpp::Parametrizable.

Definition at line 90 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::getParameter_(), and bpp::Parameter::setConstraint().

Referenced by bpp::SimpleDiscreteDistribution::restrictToConstraint().

◆ setConstraint() [2/2]

virtual void bpp::Parametrizable::setConstraint ( const std::string &  name,
std::shared_ptr< ConstraintInterface constraint 
)
pure virtualinherited

Set/Change the constraint associated with one parameter.

Parameters
nameThe name of the parameter to look for.
constraintA pointer to the constraint (may be null)
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ setMedian()

void MixtureOfDiscreteDistributions::setMedian ( bool  median)
virtual

Sets the median value to true to say that the value in a class is proportional to the median value of the class, the proportionality factor being such that the sum of the values equals the expectation of the distribution. If it is set to false, the value is the mean value in the class.

If the median value is modified, the discretization process is launched.

Parameters
mediantells how the value associated to each class is computed.

Reimplemented from bpp::AbstractDiscreteDistribution.

Definition at line 208 of file MixtureOfDiscreteDistributions.cpp.

References bpp::AbstractDiscreteDistribution::median_, updateDistribution(), and vdd_.

Referenced by getNProbability().

◆ setNamespace()

void MixtureOfDiscreteDistributions::setNamespace ( const std::string &  prefix)
virtual

Set the namespace for the parameter names.

Parameters
prefixThe 'namespace', that is a prefix to add to all parameter names. If parameter names are already prefixed, the new prefix will be used instead.

Reimplemented from bpp::AbstractParameterAliasable.

Definition at line 268 of file MixtureOfDiscreteDistributions.cpp.

References bpp::AbstractParameterAliasable::setNamespace(), vdd_, and vNestedPrefix_.

Referenced by getNProbability().

◆ setNumberOfCategories()

void MixtureOfDiscreteDistributions::setNumberOfCategories ( size_t  nbClasses)
virtual

sets the number of categories of EACH submodel to nbClasses, so the number of categories of the mixture is the sum of all these numbers.

Reimplemented from bpp::AbstractDiscreteDistribution.

Definition at line 111 of file MixtureOfDiscreteDistributions.cpp.

References updateDistribution(), and vdd_.

Referenced by getNProbability().

◆ setParametersValues() [1/2]

void bpp::AbstractParametrizable::setParametersValues ( const ParameterList parameters)
inlineoverridevirtualinherited

Update the parameters from parameters.

parameters must be a subset of all parameters available.

Parameters
parametersA list containing all parameters to update.
Exceptions
ParameterNotFoundExceptionIf a some parameter in params is not in the list.
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implements bpp::Parametrizable.

Definition at line 70 of file AbstractParametrizable.h.

References bpp::AbstractParametrizable::fireParameterChanged(), and bpp::ParameterList::setParametersValues().

Referenced by bpp::LowMemoryRescaledHmmLikelihood::setParameters(), bpp::RescaledHmmLikelihood::setParameters(), and bpp::LogsumHmmLikelihood::setParameters().

◆ setParametersValues() [2/2]

virtual void bpp::Parametrizable::setParametersValues ( const ParameterList parameters)
pure virtualinherited

Update the parameters from parameters.

parameters must be a subset of all parameters available.

Parameters
parametersA list containing all parameters to update.
Exceptions
ParameterNotFoundExceptionIf a some parameter in params is not in the list.
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ setParameterValue() [1/2]

void bpp::AbstractParametrizable::setParameterValue ( const std::string &  name,
double  value 
)
inlineoverridevirtualinherited

Set the value of parameter with name name to be equal to value.

Parameters
namethe name of the parameter to set.
valueThe value of the parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter in the list has the name name.
ConstraintExceptionIf value does not match the constraint associated to parameter name.

Implements bpp::Parametrizable.

Definition at line 64 of file AbstractParametrizable.h.

References bpp::ParameterList::createSubList(), bpp::AbstractParametrizable::fireParameterChanged(), and bpp::ParameterList::setParameterValue().

◆ setParameterValue() [2/2]

virtual void bpp::Parametrizable::setParameterValue ( const std::string &  name,
double  value 
)
pure virtualinherited

Set the value of parameter with name name to be equal to value.

Parameters
namethe name of the parameter to set.
valueThe value of the parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter in the list has the name name.
ConstraintExceptionIf value does not match the constraint associated to parameter name.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ shareParameter_()

void bpp::AbstractParameterAliasable::shareParameter_ ( const std::shared_ptr< Parameter > &  parameter)
inlineprotectedvirtualinherited

◆ shareParameters_()

void bpp::AbstractParameterAliasable::shareParameters_ ( const ParameterList parameters)
inlineprotectedvirtualinherited

◆ strictLowerBound()

bool bpp::AbstractDiscreteDistribution::strictLowerBound ( ) const
inlinevirtualinherited
Returns
The lowest value.

Reimplemented from bpp::DiscreteDistributionInterface.

Definition at line 163 of file AbstractDiscreteDistribution.h.

◆ strictUpperBound()

bool bpp::AbstractDiscreteDistribution::strictUpperBound ( ) const
inlinevirtualinherited

◆ unaliasParameters() [1/2]

virtual void bpp::ParameterAliasable::unaliasParameters ( const std::string &  p1,
const std::string &  p2 
)
pure virtualinherited

Detach two parameters previously set as 'aliased'.

The values of the two parameters will now be independent.

Parameters
p1Original parameter.
p2Aliased parameter.
Exceptions
ParameterNotFoundExceptionif p1 or p2 do not correspond to existing parameters.
Exceptionwhen trying to perform non-valid dissociation.

Implemented in bpp::AbstractParameterAliasable.

Referenced by bpp::ParameterAliasable::~ParameterAliasable().

◆ unaliasParameters() [2/2]

void AbstractParameterAliasable::unaliasParameters ( const std::string &  p1,
const std::string &  p2 
)
virtualinherited

Detach two parameters previously set as 'aliased'.

The values of the two parameters will now be independent.

Parameters
p1Original parameter.
p2Aliased parameter.
Exceptions
ParameterNotFoundExceptionif p1 or p2 do not correspond to existing parameters.
Exceptionwhen trying to perform non-valid dissociation.

Implements bpp::ParameterAliasable.

Definition at line 168 of file AbstractParameterAliasable.cpp.

References bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::AbstractParametrizable::getParameter(), bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::hasParameter(), bpp::AbstractParameterAliasable::independentParameters_, bpp::Parameter::removeParameterListener(), and bpp::ParameterList::shareParameter().

Referenced by bpp::ParametrizableCollection< N >::removeObject().

◆ updateDistribution()

Member Data Documentation

◆ bounds_

◆ DISCRETIZATION_EQUAL_INTERVAL

short AbstractDiscreteDistribution::DISCRETIZATION_EQUAL_INTERVAL = 2
staticinherited

◆ DISCRETIZATION_EQUAL_PROB

short AbstractDiscreteDistribution::DISCRETIZATION_EQUAL_PROB = 1
staticinherited

◆ DISCRETIZATION_EQUAL_PROB_WHEN_POSSIBLE

short AbstractDiscreteDistribution::DISCRETIZATION_EQUAL_PROB_WHEN_POSSIBLE = 3
staticinherited

Definition at line 30 of file AbstractDiscreteDistribution.h.

◆ discretizationScheme_

short bpp::AbstractDiscreteDistribution::discretizationScheme_
protectedinherited

◆ distribution_

std::map<double, double, Order> bpp::AbstractDiscreteDistribution::distribution_
protectedinherited

These fields must be initialized in the constructor of the derived classes.

Definition at line 80 of file AbstractDiscreteDistribution.h.

Referenced by bpp::AbstractDiscreteDistribution::add(), bpp::ConstantDistribution::ConstantDistribution(), bpp::SimpleDiscreteDistribution::discretize(), bpp::AbstractDiscreteDistribution::discretizeEqualIntervals(), bpp::AbstractDiscreteDistribution::discretizeEqualProportions(), bpp::SimpleDiscreteDistribution::Expectation(), bpp::ConstantDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::AbstractDiscreteDistribution::getCategories(), bpp::AbstractDiscreteDistribution::getCategory(), bpp::AbstractDiscreteDistribution::getIInfCumulativeProbability(), bpp::AbstractDiscreteDistribution::getInfCumulativeProbability(), bpp::SimpleDiscreteDistribution::getLowerBound(), bpp::AbstractDiscreteDistribution::getProbabilities(), bpp::AbstractDiscreteDistribution::getProbability(), bpp::AbstractDiscreteDistribution::getSSupCumulativeProbability(), bpp::AbstractDiscreteDistribution::getSupCumulativeProbability(), bpp::SimpleDiscreteDistribution::getUpperBound(), bpp::AbstractDiscreteDistribution::getValueCategory(), bpp::AbstractDiscreteDistribution::operator=(), bpp::SimpleDiscreteDistribution::pProb(), bpp::AbstractDiscreteDistribution::print(), bpp::SimpleDiscreteDistribution::qProb(), bpp::AbstractDiscreteDistribution::rand(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), bpp::AbstractDiscreteDistribution::set(), bpp::SimpleDiscreteDistribution::SimpleDiscreteDistribution(), bpp::InvariantMixedDiscreteDistribution::updateDistribution(), and updateDistribution().

◆ intMinMax_

std::shared_ptr<IntervalConstraint> bpp::AbstractDiscreteDistribution::intMinMax_
protectedinherited

the interval where the distribution is defined/restricted.

Definition at line 87 of file AbstractDiscreteDistribution.h.

Referenced by bpp::BetaDiscreteDistribution::BetaDiscreteDistribution(), bpp::AbstractDiscreteDistribution::discretize(), bpp::AbstractDiscreteDistribution::discretizeEqualIntervals(), bpp::AbstractDiscreteDistribution::discretizeEqualProportions(), bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::GammaDiscreteDistribution(), bpp::AbstractDiscreteDistribution::getCategoryIndex(), bpp::AbstractDiscreteDistribution::getValueCategory(), bpp::AbstractDiscreteDistribution::operator=(), bpp::UniformDiscreteDistribution::randC(), bpp::ExponentialDiscreteDistribution::randC(), bpp::BetaDiscreteDistribution::randC(), bpp::GammaDiscreteDistribution::randC(), bpp::TruncatedExponentialDiscreteDistribution::randC(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), bpp::AbstractDiscreteDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution(), bpp::UniformDiscreteDistribution::UniformDiscreteDistribution(), updateDistribution(), and bpp::InvariantMixedDiscreteDistribution::updateDistribution().

◆ median_

bool bpp::AbstractDiscreteDistribution::median_
protectedinherited

Tells if the values in the classes is associated to the median or not (default: false)

Definition at line 92 of file AbstractDiscreteDistribution.h.

Referenced by bpp::AbstractDiscreteDistribution::discretizeEqualProportions(), bpp::AbstractDiscreteDistribution::operator=(), bpp::InvariantMixedDiscreteDistribution::setMedian(), and setMedian().

◆ numberOfCategories_

◆ probas_

std::vector<double> bpp::MixtureOfDiscreteDistributions::probas_
protected

◆ vdd_

◆ vNestedPrefix_

std::vector<std::string> bpp::MixtureOfDiscreteDistributions::vNestedPrefix_
protected

The documentation for this class was generated from the following files: