bpp-core3  3.0.0
bpp::HmmEmissionProbabilities Class Referenceabstract

Interface for computing emission probabilities in a Hidden Markov Model. More...

#include <Bpp/Numeric/Hmm/HmmEmissionProbabilities.h>

+ Inheritance diagram for bpp::HmmEmissionProbabilities:
+ Collaboration diagram for bpp::HmmEmissionProbabilities:

Public Member Functions

virtual HmmEmissionProbabilitiesclone () const =0
 Create a copy of this object and send a pointer to it. More...
 
virtual const HmmStateAlphabetgetHmmStateAlphabet () const =0
 
virtual void setHmmStateAlphabet (const HmmStateAlphabet *stateAlphabet)=0
 Set the new hidden state alphabet. More...
 
virtual double operator() (size_t pos, size_t state) const =0
 Operator access to the emission probabilities. More...
 
virtual void computeDEmissionProbabilities (std::string &variable) const
 
virtual void computeD2EmissionProbabilities (std::string &variable) const
 
virtual const std::vector< double > & getDEmissionProbabilities (size_t pos) const
 
virtual const std::vector< double > & getD2EmissionProbabilities (size_t pos) const
 
virtual const std::vector< double > & operator() (size_t pos) const =0
 Operator access to the emission probabilities. More...
 
virtual size_t getNumberOfPositions () const =0
 
virtual bool hasParameter (const std::string &name) const =0
 Tell if there is a parameter with specified name. More...
 
virtual const ParameterListgetParameters () const =0
 Get all parameters available. More...
 
virtual const ParametergetParameter (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 &parameters)=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 &parameters)=0
 Update the parameters from parameters. More...
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 Update the parameters from parameters. 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...
 

Protected Member Functions

virtual ParameterListgetParameters_ ()=0
 Get all parameters available. More...
 

Detailed Description

Interface for computing emission probabilities in a Hidden Markov Model.

This class is part of the HMM framework. It compute the probabilities of the data conditionned on each hidden state. The emission probabilities class also has in charge the data, its putative compression, and the number of position in the sequence of observed states.

See also
HmmStateAlphabet
HmmTransitionMatrix

Definition at line 65 of file HmmEmissionProbabilities.h.

Member Function Documentation

◆ clone()

virtual HmmEmissionProbabilities* bpp::HmmEmissionProbabilities::clone ( ) const
pure virtual

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

Returns
A pointer toward the copy object.

Implements bpp::Clonable.

Referenced by bpp::LogsumHmmLikelihood::LogsumHmmLikelihood(), and bpp::LogsumHmmLikelihood::operator=().

◆ computeD2EmissionProbabilities()

virtual void bpp::HmmEmissionProbabilities::computeD2EmissionProbabilities ( std::string &  variable) const
inlinevirtual

◆ computeDEmissionProbabilities()

virtual void bpp::HmmEmissionProbabilities::computeDEmissionProbabilities ( std::string &  variable) const
inlinevirtual

◆ getD2EmissionProbabilities()

virtual const std::vector<double>& bpp::HmmEmissionProbabilities::getD2EmissionProbabilities ( size_t  pos) const
inlinevirtual

◆ getDEmissionProbabilities()

virtual const std::vector<double>& bpp::HmmEmissionProbabilities::getDEmissionProbabilities ( size_t  pos) const
inlinevirtual

◆ getHmmStateAlphabet()

◆ getNamespace()

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::ParametrizableAdapter, bpp::FunctionWrapper, and bpp::AbstractParametrizable.

Referenced by bpp::FunctionWrapper::getNamespace().

◆ getNumberOfParameters()

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::ParametrizableAdapter, bpp::FunctionWrapper, bpp::DirectionFunction, and bpp::AbstractParametrizable.

Referenced by bpp::FunctionWrapper::getNumberOfParameters(), and bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution().

◆ getNumberOfPositions()

virtual size_t bpp::HmmEmissionProbabilities::getNumberOfPositions ( ) const
pure virtual
Returns
The number of positions in the data.

Referenced by bpp::LogsumHmmLikelihood::LogsumHmmLikelihood().

◆ getParameter()

virtual const Parameter& bpp::Parametrizable::getParameter ( 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::ParametrizableAdapter, bpp::FunctionWrapper, and bpp::AbstractParametrizable.

Referenced by bpp::FunctionWrapper::getParameter().

◆ getParameterNameWithoutNamespace()

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::ParametrizableAdapter, bpp::FunctionWrapper, and bpp::AbstractParametrizable.

Referenced by bpp::FunctionWrapper::getParameterNameWithoutNamespace(), and bpp::BppOParametrizableFormat::write().

◆ getParameters()

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

◆ getParameters_()

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::DirectionFunction, and bpp::AbstractParametrizable.

Referenced by bpp::FunctionWrapper::getParameters_().

◆ getParameterValue()

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::ParametrizableAdapter, bpp::FunctionWrapper, and bpp::AbstractParametrizable.

Referenced by bpp::FunctionWrapper::getParameterValue().

◆ hasParameter()

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::ParametrizableAdapter, bpp::FunctionWrapper, and bpp::AbstractParametrizable.

Referenced by bpp::FunctionWrapper::hasParameter().

◆ matchParametersValues()

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::ParametrizableAdapter, bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, and bpp::AbstractParametrizable.

Referenced by bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::LogsumHmmLikelihood::fireParameterChanged(), bpp::BppODiscreteDistributionFormat::initialize_(), bpp::AbstractNumericalDerivative::matchParametersValues(), bpp::FunctionWrapper::matchParametersValues(), and bpp::InfinityFunctionWrapper::matchParametersValues().

◆ operator()() [1/2]

virtual const std::vector<double>& bpp::HmmEmissionProbabilities::operator() ( size_t  pos) const
pure virtual

Operator access to the emission probabilities.

This is the fastest way to get the values, but no checking is performed on the indices. For debugging purpose, the getEmissionProbability would be a safer use.

Parameters
posThe position of the sequential data to consider.
Returns
A vector of probabilities, whose size is the number of hidden states.

◆ operator()() [2/2]

virtual double bpp::HmmEmissionProbabilities::operator() ( size_t  pos,
size_t  state 
) const
pure virtual

Operator access to the emission probabilities.

This is the fastest way to get the values, but no checking is performed on the indices. For debugging purpose, the getEmissionProbability would be a safer use.

Parameters
posThe position of the sequential data to consider.
stateThe index of the hidden state to consider, as defined by the HmmStateAlphabet object associated to this class.

◆ setAllParametersValues()

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::ParametrizableAdapter, bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, and bpp::AbstractParametrizable.

Referenced by bpp::AbstractNumericalDerivative::setAllParametersValues(), bpp::FunctionWrapper::setAllParametersValues(), and bpp::InfinityFunctionWrapper::setAllParametersValues().

◆ setHmmStateAlphabet()

virtual void bpp::HmmEmissionProbabilities::setHmmStateAlphabet ( const HmmStateAlphabet stateAlphabet)
pure virtual

Set the new hidden state alphabet.

Parameters
stateAlphabetThe new state alphabet.
Exceptions
UnvalidStateAlphabetExceptionif the new alphabet is uncorrect (for instance is NULL pointer).

Referenced by bpp::LogsumHmmLikelihood::LogsumHmmLikelihood(), and bpp::LogsumHmmLikelihood::operator=().

◆ setNamespace()

virtual void bpp::Parametrizable::setNamespace ( const std::string &  prefix)
pure virtualinherited

◆ setParametersValues()

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::ParametrizableAdapter, bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, and bpp::AbstractParametrizable.

Referenced by bpp::LogsumHmmLikelihood::fireParameterChanged(), bpp::AbstractNumericalDerivative::setParametersValues(), bpp::FunctionWrapper::setParametersValues(), and bpp::InfinityFunctionWrapper::setParametersValues().

◆ setParameterValue()

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::ParametrizableAdapter, bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, and bpp::AbstractParametrizable.

Referenced by bpp::AbstractNumericalDerivative::setParameterValue(), bpp::FunctionWrapper::setParameterValue(), and bpp::InfinityFunctionWrapper::setParameterValue().


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