bpp-core3
3.0.0
|
Partial implementation of the DiscreteDistribution interface. More...
#include <Bpp/Numeric/Prob/AbstractDiscreteDistribution.h>
Classes | |
class | Order |
Comparator class for AbstractDiscreteDistribution. More... | |
Public Member Functions | |
AbstractDiscreteDistribution (size_t nbClasses, const std::string &prefix="", short discretization=DISCRETIZATION_EQUAL_PROB) | |
AbstractDiscreteDistribution (size_t nbClasses, double precision, const std::string &prefix="", short discretization=DISCRETIZATION_EQUAL_PROB) | |
AbstractDiscreteDistribution (const AbstractDiscreteDistribution &adde) | |
AbstractDiscreteDistribution & | operator= (const AbstractDiscreteDistribution &adde) |
virtual | ~AbstractDiscreteDistribution () |
virtual void | restrictToConstraint (const ConstraintInterface &c) |
Restricts the distribution to the domain where the constraint is respected, in addition of other predefined constraints. More... | |
DiscreteDistributionInterface * | clone () const =0 |
Create a copy of this object and send a pointer to it. More... | |
virtual std::string | getName () const =0 |
Get the name of the distribution. More... | |
virtual double | qProb (double x) const =0 |
Return the quantile of the continuous version of the distribution, ie y such that . More... | |
virtual double | pProb (double x) const =0 |
Return the cumulative quantile of the continuous version of the distribution, ie . More... | |
virtual double | Expectation (double a) const =0 |
Return a primitive function used for the expectation of the continuous version of the distribution, ie . More... | |
virtual size_t | getNumberOfIndependentParameters () const =0 |
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... | |
virtual void | unaliasParameters (const std::string &p1, const std::string &p2)=0 |
Detach two parameters previously set as 'aliased'. More... | |
virtual const ParameterList & | getIndependentParameters () const =0 |
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::map< std::string, std::string > | getAliases () const =0 |
virtual bool | hasParameter (const std::string &name) const =0 |
Tell if there is a parameter with specified name. More... | |
virtual const ParameterList & | getParameters () const =0 |
Get all parameters available. More... | |
virtual const Parameter & | parameter (const std::string &name) const =0 |
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... | |
virtual void | setAllParametersValues (const ParameterList ¶meters)=0 |
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... | |
virtual void | setParametersValues (const ParameterList ¶meters)=0 |
Update the parameters from parameters. More... | |
virtual bool | matchParametersValues (const ParameterList ¶meters)=0 |
Update the parameters from parameters. More... | |
virtual void | removeConstraint (const std::string &name)=0 |
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... | |
virtual size_t | getNumberOfParameters () const =0 |
Get the number of parameters. More... | |
virtual void | setNamespace (const std::string &prefix)=0 |
Set the namespace for the parameter names. More... | |
virtual std::string | getNamespace () const =0 |
virtual std::string | getParameterNameWithoutNamespace (const std::string &name) const =0 |
Resolves a parameter name according to the current namespace. More... | |
void | setNamespace (const std::string &prefix) |
Set the namespace for the parameter names. More... | |
bool | hasIndependentParameter (const std::string &name) const |
const ParameterList & | getIndependentParameters () const |
Get the minimal list of parameters to set the model. More... | |
size_t | getNumberOfIndependentParameters () const |
Get the number of independent parameters. 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... | |
void | unaliasParameters (const std::string &p1, const std::string &p2) |
Detach two parameters previously set as 'aliased'. More... | |
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... | |
virtual std::vector< std::string > | getAlias (const std::string &name) const |
virtual std::map< std::string, std::string > | getAliases () const |
std::string | getFrom (const std::string &name) const |
bool | hasParameter (const std::string &name) const override |
Tell if there is a parameter with specified name. More... | |
const ParameterList & | getParameters () const override |
Get all parameters available. More... | |
const Parameter & | parameter (const std::string &name) const override |
Get the parameter with specified name. More... | |
const std::shared_ptr< Parameter > & | getParameter (const std::string &name) const |
double | getParameterValue (const std::string &name) const override |
Get the value for parameter of name 'name'. More... | |
void | setAllParametersValues (const ParameterList ¶meters) override |
Set the parameters values to be equals to those of parameters. More... | |
void | setParameterValue (const std::string &name, double value) override |
Set the value of parameter with name name to be equal to value. More... | |
void | setParametersValues (const ParameterList ¶meters) override |
Update the parameters from parameters. More... | |
bool | matchParametersValues (const ParameterList ¶meters) override |
Update the parameters from parameters. More... | |
void | removeConstraint (const std::string &name) override |
Remove the constraint associated with one parameter, if any. More... | |
void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override |
Set/Change the constraint associated with one parameter. More... | |
size_t | getNumberOfParameters () const override |
Get the number of parameters. More... | |
std::string | getNamespace () const override |
std::string | getParameterNameWithoutNamespace (const std::string &name) const override |
Resolves a parameter name according to the current namespace. More... | |
virtual void | fireParameterChanged (const ParameterList ¶meters) |
Notify the class when one or several parameters have changed. More... | |
The DiscreteDistribution interface. | |
size_t | getNumberOfCategories () const |
void | setNumberOfCategories (size_t nbClasses) |
sets the number of categories and discretizes if there is a change in this number. More... | |
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 |
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... | |
virtual void | discretize () |
Discretizes the distribution in equiprobable classes. More... | |
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 | discretizeEqualProportions () |
void | discretizeEqualIntervals () |
virtual ParameterList & | getParameters_ ()=0 |
Get all parameters available. More... | |
void | addParameter_ (Parameter *parameter) |
void | addParameters_ (const ParameterList ¶meters) |
void | shareParameter_ (const std::shared_ptr< Parameter > ¶meter) |
void | shareParameters_ (const ParameterList ¶meters) |
void | includeParameters_ (const ParameterList ¶meters) |
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) |
Parameter & | getParameter_ (const std::string &name) |
Parameter & | getParameter_ (size_t index) |
const Parameter & | getParameter_ (size_t index) const |
Parameter & | getParameterWithNamespace_ (const std::string &name) |
const Parameter & | getParameterWithNamespace_ (const std::string &name) const |
ParameterList & | getParameters_ () override |
Get all parameters available. More... | |
Protected Attributes | |
size_t | numberOfCategories_ |
std::map< double, double, Order > | distribution_ |
std::vector< double > | bounds_ |
std::shared_ptr< IntervalConstraint > | intMinMax_ |
the interval where the distribution is defined/restricted. More... | |
bool | median_ |
short | discretizationScheme_ |
Partial implementation of the DiscreteDistribution interface.
This class uses a map to store the cateogry values as keys and probabilities as values. It uses its own comparator class to deal with double precision. By default, category values that differ less than 10E-9 will be considered identical.
Definition at line 23 of file AbstractDiscreteDistribution.h.
AbstractDiscreteDistribution::AbstractDiscreteDistribution | ( | size_t | nbClasses, |
const std::string & | prefix = "" , |
||
short | discretization = DISCRETIZATION_EQUAL_PROB |
||
) |
Definition at line 16 of file AbstractDiscreteDistribution.cpp.
AbstractDiscreteDistribution::AbstractDiscreteDistribution | ( | size_t | nbClasses, |
double | precision, | ||
const std::string & | prefix = "" , |
||
short | discretization = DISCRETIZATION_EQUAL_PROB |
||
) |
With additional precision value to discriminate categories (default 1e-12)
Definition at line 26 of file AbstractDiscreteDistribution.cpp.
AbstractDiscreteDistribution::AbstractDiscreteDistribution | ( | const AbstractDiscreteDistribution & | adde | ) |
Definition at line 36 of file AbstractDiscreteDistribution.cpp.
|
inlinevirtual |
Definition at line 111 of file AbstractDiscreteDistribution.h.
References add(), getCategories(), getCategory(), getCategoryIndex(), getIInfCumulativeProbability(), getInfCumulativeProbability(), getNumberOfCategories(), getProbabilities(), getProbability(), getSSupCumulativeProbability(), getSupCumulativeProbability(), getValueCategory(), rand(), and setNumberOfCategories().
|
virtual |
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.
category | The class value. |
probability | The class probability. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 151 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 196 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::addParameter_(), bpp::Parameter::getName(), and bpp::ParameterList::shareParameter().
Referenced by bpp::ParametrizableCollection< N >::addObject(), bpp::BetaDiscreteDistribution::BetaDiscreteDistribution(), bpp::ConstantDistribution::ConstantDistribution(), bpp::DirichletDiscreteDistribution::DirichletDiscreteDistribution(), bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), bpp::GammaDiscreteDistribution::GammaDiscreteDistribution(), bpp::GaussianDiscreteDistribution::GaussianDiscreteDistribution(), bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::SimpleDiscreteDistribution::SimpleDiscreteDistribution(), bpp::Simplex::Simplex(), and bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 202 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::addParameters_(), bpp::AliasParameterListener::getName(), bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
Referenced by bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), and bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions().
|
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.
p1 | Original parameter. |
p2 | Aliased parameter. |
ParameterNotFoundException | if p1 or p2 do not correspond to existing parameters. |
Exception | when trying to perform non-valid association. |
Implemented in bpp::AbstractParameterAliasable.
Referenced by bpp::ParameterAliasable::~ParameterAliasable().
|
pure virtualinherited |
alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden.
unparsedParams | the map of the links : <A,B> matches for A->B aliasing. |
verbose | verbosity |
Implemented in bpp::AbstractParameterAliasable.
|
virtualinherited |
alias the parameters.
p1 | name of the parameter to which the other parameter is aliased |
p2 | name of the aliased parameter, which will be deleted from independent parameters list |
Implements bpp::ParameterAliasable.
Definition at line 67 of file AbstractParameterAliasable.cpp.
References bpp::Parameter::addParameterListener(), bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::ParameterList::deleteParameter(), bpp::ApplicationTools::displayWarning(), bpp::Parameter::getConstraint(), bpp::AbstractParametrizable::getNamespace(), bpp::AbstractParametrizable::getNumberOfParameters(), bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::getParameters(), bpp::AbstractParametrizable::getParameters_(), bpp::Parameter::hasConstraint(), bpp::AbstractParametrizable::hasParameter(), bpp::ParameterList::hasParameter(), bpp::AbstractParameterAliasable::independentParameters_, bpp::Parameter::setConstraint(), bpp::ParameterList::shareParameters(), bpp::ParameterList::size(), and bpp::ParameterList::whichParameterHasName().
Referenced by bpp::ParametrizableCollection< N >::addObject(), and bpp::AbstractParameterAliasable::aliasParameters().
|
virtualinherited |
alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden.
unparsedParams | the map of the links : <A,B> matches for A->B aliasing. |
verbose | verbosity |
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().
|
pure virtualinherited |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Implemented in bpp::SimpleDiscreteDistribution, bpp::TruncatedExponentialDiscreteDistribution, bpp::GammaDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::InvariantMixedDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::GaussianDiscreteDistribution, bpp::UniformDiscreteDistribution, and bpp::ConstantDistribution.
Referenced by bpp::DiscreteDistributionInterface::~DiscreteDistributionInterface().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 237 of file AbstractParameterAliasable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::deleteParameter_(), and bpp::ParameterList::hasParameter().
Referenced by bpp::ParametrizableCollection< N >::removeObject().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 245 of file AbstractParameterAliasable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::deleteParameter_(), and bpp::ParameterList::hasParameter().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 252 of file AbstractParameterAliasable.h.
|
virtual |
Discretizes the distribution in equiprobable classes.
Implements bpp::DiscreteDistributionInterface.
Reimplemented in bpp::MixtureOfDiscreteDistributions, bpp::InvariantMixedDiscreteDistribution, bpp::SimpleDiscreteDistribution, and bpp::ConstantDistribution.
Definition at line 494 of file AbstractDiscreteDistribution.cpp.
References bounds_, DISCRETIZATION_EQUAL_INTERVAL, DISCRETIZATION_EQUAL_PROB, discretizationScheme_, discretizeEqualIntervals(), discretizeEqualProportions(), intMinMax_, and numberOfCategories_.
Referenced by bpp::BetaDiscreteDistribution::BetaDiscreteDistribution(), bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::GammaDiscreteDistribution(), bpp::GaussianDiscreteDistribution::GaussianDiscreteDistribution(), restrictToConstraint(), setMedian(), setNumberOfCategories(), bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution(), and bpp::UniformDiscreteDistribution::UniformDiscreteDistribution().
|
protected |
Definition at line 454 of file AbstractDiscreteDistribution.cpp.
References bounds_, distribution_, intMinMax_, numberOfCategories_, and bpp::DiscreteDistributionInterface::pProb().
Referenced by discretize(), and setMedian().
|
protected |
Definition at line 294 of file AbstractDiscreteDistribution.cpp.
References bounds_, distribution_, bpp::DiscreteDistributionInterface::Expectation(), intMinMax_, median_, numberOfCategories_, bpp::DiscreteDistributionInterface::pProb(), precision(), bpp::DiscreteDistributionInterface::qProb(), and bpp::NumConstants::TINY().
Referenced by discretize(), and setMedian().
|
pure virtualinherited |
Return a primitive function used for the expectation of the continuous version of the distribution, ie .
Implemented in bpp::SimpleDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::TruncatedExponentialDiscreteDistribution, bpp::InvariantMixedDiscreteDistribution, bpp::GammaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::UniformDiscreteDistribution, bpp::ConstantDistribution, and bpp::GaussianDiscreteDistribution.
Referenced by discretizeEqualProportions(), and bpp::DiscreteDistributionInterface::~DiscreteDistributionInterface().
|
inlinevirtualinherited |
Notify the class when one or several parameters have changed.
parameters | A ParameterList object with parameters that changed. |
Reimplemented in bpp::TestFunction, bpp::OrderedSimplex, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::LowMemoryRescaledHmmLikelihood, bpp::Simplex, bpp::ParametrizableCollection< N >, bpp::ReparametrizationFunctionWrapper, bpp::MixtureOfDiscreteDistributions, bpp::SimpleDiscreteDistribution, bpp::DirichletDiscreteDistribution, bpp::FullHmmTransitionMatrix, bpp::TruncatedExponentialDiscreteDistribution, bpp::AutoCorrelationTransitionMatrix, bpp::GammaDiscreteDistribution, bpp::InvariantMixedDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::GaussianDiscreteDistribution, bpp::UniformDiscreteDistribution, and bpp::ConstantDistribution.
Definition at line 108 of file AbstractParametrizable.h.
Referenced by bpp::ConstantDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::DirichletDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::AbstractParametrizable::matchParametersValues(), bpp::AbstractParametrizable::setAllParametersValues(), bpp::AbstractParametrizable::setParametersValues(), and bpp::AbstractParametrizable::setParameterValue().
|
pure virtualinherited |
name | The name of the parameter to look for. |
Implemented in bpp::AbstractParameterAliasable.
Referenced by bpp::ParametrizableCollection< N >::addObject(), bpp::BppOParametrizableFormat::write(), and bpp::ParameterAliasable::~ParameterAliasable().
|
virtualinherited |
name | The 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().
|
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().
|
pure virtualinherited |
Implemented in bpp::AbstractParameterAliasable.
Referenced by bpp::ParameterAliasable::~ParameterAliasable().
|
virtualinherited |
Implements bpp::ParameterAliasable.
Definition at line 225 of file AbstractParameterAliasable.cpp.
References bpp::AbstractParameterAliasable::aliasListenersRegister_, and bpp::AbstractParameterAliasable::getAlias().
|
inlinevirtual |
Implements bpp::DiscreteDistributionInterface.
Definition at line 141 of file AbstractDiscreteDistribution.h.
Referenced by getBounds().
|
virtual |
Implements bpp::DiscreteDistributionInterface.
Definition at line 527 of file AbstractDiscreteDistribution.cpp.
References getBound(), getLowerBound(), getUpperBound(), and numberOfCategories_.
Referenced by strictUpperBound().
|
virtual |
Implements bpp::DiscreteDistributionInterface.
Definition at line 112 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
virtual |
categoryIndex | Class index. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 81 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
virtual |
value |
Implements bpp::DiscreteDistributionInterface.
Definition at line 278 of file AbstractDiscreteDistribution.cpp.
References bounds_, intMinMax_, and bpp::TextTools::toString().
Referenced by ~AbstractDiscreteDistribution().
|
inherited |
name | The name of the parameter to look for. |
Definition at line 280 of file AbstractParameterAliasable.cpp.
References bpp::AbstractParameterAliasable::aliasListenersRegister_.
|
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().
|
virtual |
category | The class value. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 200 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
pure virtualinherited |
Get the minimal list of parameters to set the model.
If no parameters are aliased, this is the same a getParameters().
Implemented in bpp::AbstractParameterAliasable.
Referenced by bpp::BppODiscreteDistributionFormat::initialize_(), bpp::BppOParametrizableFormat::write(), bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution(), and bpp::ParameterAliasable::~ParameterAliasable().
|
inlinevirtualinherited |
Get the minimal list of parameters to set the model.
If no parameters are aliased, this is the same a getParameters().
Implements bpp::ParameterAliasable.
Definition at line 135 of file AbstractParameterAliasable.h.
|
virtual |
category | The class value. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 185 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
inlinevirtual |
methods about the range of the definition
Reimplemented from bpp::DiscreteDistributionInterface.
Reimplemented in bpp::SimpleDiscreteDistribution, and bpp::ConstantDistribution.
Definition at line 153 of file AbstractDiscreteDistribution.h.
Referenced by bpp::BetaDiscreteDistribution::fireParameterChanged(), getBounds(), bpp::InvariantMixedDiscreteDistribution::updateDistribution(), and bpp::MixtureOfDiscreteDistributions::updateDistribution().
|
pure virtualinherited |
Get the name of the distribution.
Implemented in bpp::SimpleDiscreteDistribution, bpp::TruncatedExponentialDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::InvariantMixedDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::ConstantDistribution, bpp::GaussianDiscreteDistribution, bpp::UniformDiscreteDistribution, and bpp::GammaDiscreteDistribution.
Referenced by bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution(), and bpp::DiscreteDistributionInterface::~DiscreteDistributionInterface().
|
inlineoverridevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 99 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), and bpp::AbstractParametrizable::prefix_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::Simplex::setFrequencies(), and bpp::AbstractParameterAliasable::setNamespace().
|
pure virtualinherited |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
virtual |
Implements bpp::DiscreteDistributionInterface.
Definition at line 61 of file AbstractDiscreteDistribution.cpp.
References numberOfCategories_.
Referenced by bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution(), and ~AbstractDiscreteDistribution().
|
pure virtualinherited |
Get the number of independent parameters.
Implemented in bpp::AbstractParameterAliasable.
Referenced by bpp::ParameterAliasable::~ParameterAliasable().
|
inlinevirtualinherited |
Get the number of independent parameters.
Implements bpp::ParameterAliasable.
Definition at line 137 of file AbstractParameterAliasable.h.
References bpp::AliasParameterListener::getAlias(), bpp::AliasParameterListener::getFrom(), and bpp::ParameterList::size().
|
inlineoverridevirtualinherited |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 95 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::setNamespace(), and bpp::ParameterList::size().
Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParameterAliasable::aliasParameters(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::AbstractParameterAliasable::operator=(), bpp::ConstantDistribution::restrictToConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
pure virtualinherited |
Get the number of parameters.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::AbstractParametrizable, and bpp::DirectionFunction.
Referenced by bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution(), and bpp::Parametrizable::~Parametrizable().
|
inlineinherited |
Definition at line 48 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter().
Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParameterAliasable::operator=(), and bpp::AbstractParameterAliasable::unaliasParameters().
|
inlineprotectedinherited |
Definition at line 211 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter().
|
inlineprotectedinherited |
Definition at line 216 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter().
|
inlineprotectedinherited |
name | The name of the parameter. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 164 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::hasParameter(), and bpp::ParameterList::parameter().
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::AbstractParametrizable::removeConstraint(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), bpp::InvariantMixedDiscreteDistribution::restrictToConstraint(), bpp::AbstractParametrizable::setConstraint(), and bpp::AbstractParameterAliasable::unaliasParameters().
|
inlineprotectedinherited |
Definition at line 190 of file AbstractParametrizable.h.
References bpp::ParameterList::size().
|
inlineprotectedinherited |
Definition at line 197 of file AbstractParametrizable.h.
References bpp::ParameterList::size().
|
overridevirtualinherited |
Resolves a parameter name according to the current namespace.
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=().
|
pure virtualinherited |
Resolves a parameter name according to the current namespace.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), bpp::BppOParametrizableFormat::write(), and bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Get 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(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), and bpp::ParametrizableCollection< N >::removeObject().
|
pure virtualinherited |
Get all parameters available.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::DirectionFunction, and bpp::AbstractParametrizable.
Referenced by bpp::ParameterAliasableAdapter::getIndependentParameters(), bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), bpp::BppOParametrizableFormat::write(), and bpp::Parametrizable::~Parametrizable().
|
protectedpure virtualinherited |
Get all parameters available.
Implemented in bpp::FunctionWrapper, bpp::AbstractParametrizable, and bpp::DirectionFunction.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverrideprotectedvirtualinherited |
Get 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=().
|
inlineoverridevirtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 53 of file AbstractParametrizable.h.
References bpp::Parameter::getValue(), and bpp::AbstractParametrizable::parameter().
Referenced by bpp::DirichletDiscreteDistribution::applyParameters(), bpp::ConstantDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::AutoCorrelationTransitionMatrix::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::Simplex::fireParameterChanged(), bpp::BetaDiscreteDistribution::randC(), bpp::ExponentialDiscreteDistribution::randC(), bpp::GammaDiscreteDistribution::randC(), bpp::TruncatedExponentialDiscreteDistribution::randC(), and bpp::ConstantDistribution::restrictToConstraint().
|
pure virtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), and bpp::Parametrizable::~Parametrizable().
|
inlineprotectedinherited |
name | The name of the parameter, including its namespace. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 176 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter_().
|
inlineprotectedinherited |
name | The name of the parameter, including its namespace. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 185 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameter().
|
virtual |
Implements bpp::DiscreteDistributionInterface.
Definition at line 128 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
virtual |
categoryIndex | Class index. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 93 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
virtual |
category | The value associated to the class. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 105 of file AbstractDiscreteDistribution.cpp.
References distribution_.
|
virtual |
category | The class value. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 234 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
virtual |
category | The class value. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 217 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by ~AbstractDiscreteDistribution().
|
inlinevirtual |
Reimplemented from bpp::DiscreteDistributionInterface.
Reimplemented in bpp::SimpleDiscreteDistribution, and bpp::ConstantDistribution.
Definition at line 158 of file AbstractDiscreteDistribution.h.
Referenced by bpp::BetaDiscreteDistribution::fireParameterChanged(), getBounds(), and bpp::MixtureOfDiscreteDistributions::updateDistribution().
|
virtual |
value |
Implements bpp::DiscreteDistributionInterface.
Definition at line 259 of file AbstractDiscreteDistribution.cpp.
References bounds_, distribution_, intMinMax_, and bpp::TextTools::toString().
Referenced by ~AbstractDiscreteDistribution().
|
inlineinherited |
Definition at line 133 of file AbstractParameterAliasable.h.
References bpp::ParameterList::hasParameter().
|
pure virtualinherited |
Tell if there is a parameter with specified name.
name | The name of the parameter to look for. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Tell if there is a parameter with specified name.
name | The name of the parameter to look for. |
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().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 227 of file AbstractParameterAliasable.h.
References bpp::AliasParameterListener::getName(), bpp::AbstractParametrizable::includeParameters_(), bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
|
inlineoverridevirtualinherited |
Update the parameters from parameters.
Only common parameters with parameters will be updated.
parameters | A list of parameters. |
ConstraintException | If 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().
|
pure virtualinherited |
Update the parameters from parameters.
Only common parameters with parameters will be updated.
parameters | A list of parameters. |
ConstraintException | If 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().
AbstractDiscreteDistribution & AbstractDiscreteDistribution::operator= | ( | const AbstractDiscreteDistribution & | adde | ) |
Definition at line 46 of file AbstractDiscreteDistribution.cpp.
References bounds_, discretizationScheme_, distribution_, intMinMax_, median_, numberOfCategories_, and bpp::AbstractParameterAliasable::operator=().
Referenced by bpp::ConstantDistribution::operator=(), bpp::UniformDiscreteDistribution::operator=(), bpp::GaussianDiscreteDistribution::operator=(), bpp::ExponentialDiscreteDistribution::operator=(), bpp::InvariantMixedDiscreteDistribution::operator=(), bpp::GammaDiscreteDistribution::operator=(), bpp::TruncatedExponentialDiscreteDistribution::operator=(), bpp::MixtureOfDiscreteDistributions::operator=(), and bpp::SimpleDiscreteDistribution::operator=().
|
inlineoverridevirtualinherited |
Get the parameter with specified name.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implements bpp::Parametrizable.
Definition at line 43 of file AbstractParametrizable.h.
References bpp::ParameterList::parameter().
Referenced by bpp::AbstractParameterAliasable::getAliasedParameters(), bpp::ReparametrizationDerivableFirstOrderWrapper::getFirstOrderDerivative(), bpp::AbstractParameterAliasable::getFromParameters(), bpp::AbstractParametrizable::getParameterValue(), bpp::AbstractParametrizable::getParameterWithNamespace_(), and bpp::ReparametrizationDerivableSecondOrderWrapper::getSecondOrderDerivative().
|
pure virtualinherited |
Get the parameter with specified name.
name | The name of the parameter to look for. |
ParameterNotFoundException | if 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().
|
pure virtualinherited |
Return the cumulative quantile of the continuous version of the distribution, ie .
Implemented in bpp::SimpleDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::InvariantMixedDiscreteDistribution, bpp::TruncatedExponentialDiscreteDistribution, bpp::GammaDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::UniformDiscreteDistribution, bpp::ConstantDistribution, and bpp::GaussianDiscreteDistribution.
Referenced by discretizeEqualIntervals(), discretizeEqualProportions(), and bpp::DiscreteDistributionInterface::~DiscreteDistributionInterface().
|
inline |
Definition at line 177 of file AbstractDiscreteDistribution.h.
Referenced by discretizeEqualProportions(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), and bpp::SimpleDiscreteDistribution::SimpleDiscreteDistribution().
|
virtual |
Print the distribution (categories and corresponding probabilities) to a stream.
out | The outstream where to print the distribution. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 249 of file AbstractDiscreteDistribution.cpp.
References distribution_.
Referenced by strictUpperBound().
|
pure virtualinherited |
Return the quantile of the continuous version of the distribution, ie y such that .
Implemented in bpp::SimpleDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::TruncatedExponentialDiscreteDistribution, bpp::InvariantMixedDiscreteDistribution, bpp::GammaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::UniformDiscreteDistribution, bpp::ConstantDistribution, and bpp::GaussianDiscreteDistribution.
Referenced by discretizeEqualProportions(), and bpp::DiscreteDistributionInterface::~DiscreteDistributionInterface().
|
virtual |
Draw a random number from this distribution.
This number will be one of the class values, drawn according to the class probabilities.
Implements bpp::DiscreteDistributionInterface.
Definition at line 167 of file AbstractDiscreteDistribution.cpp.
References distribution_, and bpp::RandomTools::giveRandomNumberBetweenZeroAndEntry().
Referenced by ~AbstractDiscreteDistribution().
|
inlinevirtual |
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.
Exception | If 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.
|
inlineoverridevirtualinherited |
Remove the constraint associated with one parameter, if any.
name | The name of the parameter to look for. |
ParameterNotFoundException | if 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().
|
pure virtualinherited |
Remove the constraint associated with one parameter, if any.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineprotectedinherited |
Definition at line 262 of file AbstractParameterAliasable.h.
References bpp::ParameterList::reset(), and bpp::AbstractParametrizable::resetParameters_().
Referenced by bpp::ParametrizableCollection< N >::clear().
|
virtual |
Restricts the distribution to the domain where the constraint is respected, in addition of other predefined constraints.
c | The Constraint to respect. |
Implements bpp::DiscreteDistributionInterface.
Reimplemented in bpp::InvariantMixedDiscreteDistribution, bpp::SimpleDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::TruncatedExponentialDiscreteDistribution, and bpp::ConstantDistribution.
Definition at line 539 of file AbstractDiscreteDistribution.cpp.
References discretize(), and intMinMax_.
Referenced by bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), and setMedian().
|
virtual |
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.
category | The class value. |
probability | The class probability. |
Implements bpp::DiscreteDistributionInterface.
Definition at line 144 of file AbstractDiscreteDistribution.cpp.
References distribution_.
|
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 | A list with all parameters. |
ParameterNotFoundException | If a some parameter in the list is not in params. |
ConstraintException | If 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().
|
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 | A list with all parameters. |
ParameterNotFoundException | If a some parameter in the list is not in params. |
ConstraintException | If 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().
|
inlineoverridevirtualinherited |
Set/Change the constraint associated with one parameter.
name | The name of the parameter to look for. |
constraint | A pointer to the constraint (may be null) |
ParameterNotFoundException | if 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().
|
pure virtualinherited |
Set/Change the constraint associated with one parameter.
name | The name of the parameter to look for. |
constraint | A pointer to the constraint (may be null) |
ParameterNotFoundException | if no parameter with this name is found. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlinevirtual |
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.
median | tells how the value associated to each class is computed. |
Implements bpp::DiscreteDistributionInterface.
Reimplemented in bpp::MixtureOfDiscreteDistributions, and bpp::InvariantMixedDiscreteDistribution.
Definition at line 179 of file AbstractDiscreteDistribution.h.
References discretize(), discretizeEqualIntervals(), discretizeEqualProportions(), and restrictToConstraint().
|
virtualinherited |
Set the namespace for the parameter names.
prefix | The 'namespace', that is a prefix to add to all parameter names. If parameter names are already prefixed, the new prefix will be used instead. |
Implements bpp::Parametrizable.
Reimplemented in bpp::MixtureOfDiscreteDistributions, and bpp::InvariantMixedDiscreteDistribution.
Definition at line 186 of file AbstractParameterAliasable.cpp.
References bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::AbstractParametrizable::getNamespace(), bpp::AbstractParametrizable::setNamespace(), and bpp::TextTools::startsWith().
Referenced by bpp::InvariantMixedDiscreteDistribution::setNamespace(), and bpp::MixtureOfDiscreteDistributions::setNamespace().
|
pure virtualinherited |
Set the namespace for the parameter names.
prefix | The 'namespace', that is a prefix to add to all parameter names. If parameter names are already prefixed, the new prefix will be used instead. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::LowMemoryRescaledHmmLikelihood, bpp::AbstractParameterAliasable, bpp::MixtureOfDiscreteDistributions, bpp::AbstractParametrizable, and bpp::InvariantMixedDiscreteDistribution.
Referenced by bpp::Parametrizable::~Parametrizable().
|
virtual |
sets the number of categories and discretizes if there is a change in this number.
Implements bpp::DiscreteDistributionInterface.
Reimplemented in bpp::MixtureOfDiscreteDistributions, and bpp::InvariantMixedDiscreteDistribution.
Definition at line 66 of file AbstractDiscreteDistribution.cpp.
References discretize(), and numberOfCategories_.
Referenced by ~AbstractDiscreteDistribution().
|
inlineoverridevirtualinherited |
Update the parameters from parameters.
parameters must be a subset of all parameters available.
parameters | A list containing all parameters to update. |
ParameterNotFoundException | If a some parameter in params is not in the list. |
ConstraintException | If 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().
|
pure virtualinherited |
Update the parameters from parameters.
parameters must be a subset of all parameters available.
parameters | A list containing all parameters to update. |
ParameterNotFoundException | If a some parameter in params is not in the list. |
ConstraintException | If 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().
|
inlineoverridevirtualinherited |
Set the value of parameter with name name to be equal to value.
name | the name of the parameter to set. |
value | The value of the parameter. |
ParameterNotFoundException | If no parameter in the list has the name name. |
ConstraintException | If 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().
|
pure virtualinherited |
Set the value of parameter with name name to be equal to value.
name | the name of the parameter to set. |
value | The value of the parameter. |
ParameterNotFoundException | If no parameter in the list has the name name. |
ConstraintException | If 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().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 212 of file AbstractParameterAliasable.h.
References bpp::ParameterList::shareParameter(), and bpp::AbstractParametrizable::shareParameter_().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 218 of file AbstractParameterAliasable.h.
References bpp::AliasParameterListener::getName(), bpp::ParameterList::shareParameter(), bpp::AbstractParametrizable::shareParameters_(), and bpp::ParameterList::size().
|
inlinevirtual |
Reimplemented from bpp::DiscreteDistributionInterface.
Definition at line 163 of file AbstractDiscreteDistribution.h.
|
inlinevirtual |
Reimplemented from bpp::DiscreteDistributionInterface.
Definition at line 168 of file AbstractDiscreteDistribution.h.
References getBounds(), and print().
|
pure virtualinherited |
Detach two parameters previously set as 'aliased'.
The values of the two parameters will now be independent.
p1 | Original parameter. |
p2 | Aliased parameter. |
ParameterNotFoundException | if p1 or p2 do not correspond to existing parameters. |
Exception | when trying to perform non-valid dissociation. |
Implemented in bpp::AbstractParameterAliasable.
Referenced by bpp::ParameterAliasable::~ParameterAliasable().
|
virtualinherited |
Detach two parameters previously set as 'aliased'.
The values of the two parameters will now be independent.
p1 | Original parameter. |
p2 | Aliased parameter. |
ParameterNotFoundException | if p1 or p2 do not correspond to existing parameters. |
Exception | when 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().
|
protected |
Definition at line 82 of file AbstractDiscreteDistribution.h.
Referenced by bpp::SimpleDiscreteDistribution::discretize(), discretize(), discretizeEqualIntervals(), discretizeEqualProportions(), getCategoryIndex(), getValueCategory(), operator=(), bpp::InvariantMixedDiscreteDistribution::updateDistribution(), and bpp::MixtureOfDiscreteDistributions::updateDistribution().
|
static |
Definition at line 29 of file AbstractDiscreteDistribution.h.
Referenced by discretize().
|
static |
Definition at line 28 of file AbstractDiscreteDistribution.h.
Referenced by discretize().
|
static |
Definition at line 30 of file AbstractDiscreteDistribution.h.
|
protected |
Discretization policy.
Definition at line 97 of file AbstractDiscreteDistribution.h.
Referenced by discretize(), and operator=().
|
protected |
These fields must be initialized in the constructor of the derived classes.
Definition at line 80 of file AbstractDiscreteDistribution.h.
Referenced by add(), bpp::ConstantDistribution::ConstantDistribution(), bpp::SimpleDiscreteDistribution::discretize(), discretizeEqualIntervals(), discretizeEqualProportions(), bpp::SimpleDiscreteDistribution::Expectation(), bpp::ConstantDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), getCategories(), getCategory(), getIInfCumulativeProbability(), getInfCumulativeProbability(), bpp::SimpleDiscreteDistribution::getLowerBound(), getProbabilities(), getProbability(), getSSupCumulativeProbability(), getSupCumulativeProbability(), bpp::SimpleDiscreteDistribution::getUpperBound(), getValueCategory(), operator=(), bpp::SimpleDiscreteDistribution::pProb(), print(), bpp::SimpleDiscreteDistribution::qProb(), rand(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), set(), bpp::SimpleDiscreteDistribution::SimpleDiscreteDistribution(), bpp::MixtureOfDiscreteDistributions::updateDistribution(), and bpp::InvariantMixedDiscreteDistribution::updateDistribution().
|
protected |
the interval where the distribution is defined/restricted.
Definition at line 87 of file AbstractDiscreteDistribution.h.
Referenced by bpp::BetaDiscreteDistribution::BetaDiscreteDistribution(), discretize(), discretizeEqualIntervals(), discretizeEqualProportions(), bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::GammaDiscreteDistribution(), getCategoryIndex(), getValueCategory(), operator=(), bpp::UniformDiscreteDistribution::randC(), bpp::BetaDiscreteDistribution::randC(), bpp::ExponentialDiscreteDistribution::randC(), bpp::GammaDiscreteDistribution::randC(), bpp::TruncatedExponentialDiscreteDistribution::randC(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution(), bpp::UniformDiscreteDistribution::UniformDiscreteDistribution(), bpp::MixtureOfDiscreteDistributions::updateDistribution(), and bpp::InvariantMixedDiscreteDistribution::updateDistribution().
|
protected |
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 discretizeEqualProportions(), operator=(), bpp::InvariantMixedDiscreteDistribution::setMedian(), and bpp::MixtureOfDiscreteDistributions::setMedian().
|
protected |
Definition at line 76 of file AbstractDiscreteDistribution.h.
Referenced by bpp::SimpleDiscreteDistribution::discretize(), discretize(), discretizeEqualIntervals(), discretizeEqualProportions(), getBounds(), getNumberOfCategories(), operator=(), setNumberOfCategories(), bpp::SimpleDiscreteDistribution::SimpleDiscreteDistribution(), bpp::MixtureOfDiscreteDistributions::updateDistribution(), and bpp::InvariantMixedDiscreteDistribution::updateDistribution().