bpp-core
2.2.0
|
A simple implementation of hidden Markov models recursion. More...
#include <Bpp/Numeric/Hmm/RescaledHmmLikelihood.h>
Public Member Functions | |
RescaledHmmLikelihood (HmmStateAlphabet *hiddenAlphabet, HmmTransitionMatrix *transitionMatrix, HmmEmissionProbabilities *emissionProbabilities, const std::string &prefix) throw (Exception) | |
Build a new RescaledHmmLikelihood object. More... | |
RescaledHmmLikelihood (const RescaledHmmLikelihood &lik) | |
RescaledHmmLikelihood & | operator= (const RescaledHmmLikelihood &lik) |
virtual | ~RescaledHmmLikelihood () |
RescaledHmmLikelihood * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
const HmmStateAlphabet & | getHmmStateAlphabet () const |
HmmStateAlphabet & | getHmmStateAlphabet () |
const HmmTransitionMatrix & | getHmmTransitionMatrix () const |
HmmTransitionMatrix & | getHmmTransitionMatrix () |
const HmmEmissionProbabilities & | getHmmEmissionProbabilities () const |
HmmEmissionProbabilities & | getHmmEmissionProbabilities () |
void | setBreakPoints (const std::vector< size_t > &breakPoints) |
const std::vector< size_t > & | getBreakPoints () const |
void | setParameters (const ParameterList &pl) throw (Exception) |
Set the point where the function must be computed. More... | |
double | getValue () const throw (Exception) |
Get the value of the function at the current point. More... | |
double | getLogLikelihood () const |
double | getLikelihoodForASite (size_t site) const |
Get the likelihood for a site. More... | |
Vdouble | getLikelihoodForEachSite () const |
Get the likelihood for each site. More... | |
void | fireParameterChanged (const ParameterList &pl) |
Notify the class when one or several parameters have changed. More... | |
Vdouble | getHiddenStatesPosteriorProbabilitiesForASite (size_t site) const |
void | getHiddenStatesPosteriorProbabilities (std::vector< std::vector< double > > &probs, bool append=false) const throw (Exception) |
virtual double | d2f (const std::string &variable, const ParameterList ¶meters) throw (Exception) |
Get the value of the second order derivative of the function according to a given set of parameters. More... | |
virtual double | d2f (const std::string &variable1, const std::string &variable2, const ParameterList ¶meters) throw (Exception) |
Get the value of the cross derivative of the function according to a given set of parameters. More... | |
virtual double | df (const std::string &variable, const ParameterList ¶meters) throw (Exception) |
Get the value of the first derivative of the function according to a given set of parameters. More... | |
virtual double | f (const ParameterList ¶meters) throw (Exception) |
Get the value of the function according to a given set of parameters. More... | |
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 & | getParameter (const std::string &name) const =0 throw (ParameterNotFoundException) |
Get the parameter with specified name. More... | |
virtual double | getParameterValue (const std::string &name) const =0 throw (ParameterNotFoundException) |
Get the value for parameter of name 'name'. More... | |
virtual void | setAllParametersValues (const ParameterList ¶meters)=0 throw (ParameterNotFoundException, ConstraintException) |
Set the parameters values to be equals to those of parameters. More... | |
virtual void | setParameterValue (const std::string &name, double value)=0 throw (ParameterNotFoundException, ConstraintException) |
Set the value of parameter with name name to be equal to value. More... | |
virtual void | setParametersValues (const ParameterList ¶meters)=0 throw (ParameterNotFoundException, ConstraintException) |
Update the parameters from parameters. More... | |
virtual bool | matchParametersValues (const ParameterList ¶meters)=0 throw (ConstraintException) |
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... | |
bool | hasParameter (const std::string &name) const |
Tell if there is a parameter with specified name. More... | |
const ParameterList & | getParameters () const |
Get all parameters available. More... | |
const Parameter & | getParameter (const std::string &name) const throw (ParameterNotFoundException) |
Get the parameter with specified name. More... | |
double | getParameterValue (const std::string &name) const throw (ParameterNotFoundException) |
Get the value for parameter of name 'name'. More... | |
void | setAllParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
Set the parameters values to be equals to those of parameters. More... | |
void | setParameterValue (const std::string &name, double value) throw (ParameterNotFoundException, ConstraintException) |
Set the value of parameter with name name to be equal to value. More... | |
void | setParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
Update the parameters from parameters. More... | |
bool | matchParametersValues (const ParameterList ¶meters) throw (ConstraintException) |
Update the parameters from parameters. More... | |
size_t | getNumberOfParameters () const |
Get the number of parameters. More... | |
void | setNamespace (const std::string &prefix) |
Set the namespace for the parameter names. More... | |
std::string | getNamespace () const |
std::string | getParameterNameWithoutNamespace (const std::string &name) const |
Resolves a parameter name according to the current namespace. More... | |
void | enableFirstOrderDerivatives (bool yn) |
Tell if derivatives must be computed. More... | |
bool | enableFirstOrderDerivatives () const |
Tell if derivatives must be computed. More... | |
double | getFirstOrderDerivative (const std::string &variable) const throw (Exception) |
Get the derivative of the function at the current point. More... | |
double | getDLogLikelihood () const |
void | enableSecondOrderDerivatives (bool yn) |
Tell if derivatives must be computed. More... | |
bool | enableSecondOrderDerivatives () const |
Tell if derivatives must be computed. More... | |
double | getSecondOrderDerivative (const std::string &variable) const throw (Exception) |
Get the second order derivative of the function at the current point. More... | |
double | getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const throw (Exception) |
Get the value of the cross derivative of the function according to a given set of parameters. More... | |
double | getD2LogLikelihood () const |
Protected Member Functions | |
void | computeForward_ () |
void | computeBackward_ () const |
void | computeDLikelihood_ () const |
void | computeD2Likelihood_ () const |
void | computeDForward_ () const |
void | computeD2Forward_ () const |
void | addParameter_ (Parameter *parameter) |
void | addParameters_ (const ParameterList ¶meters) |
void | deleteParameter_ (size_t index) throw (IndexOutOfBoundsException) |
void | deleteParameter_ (std::string &name) |
void | deleteParameters_ (const std::vector< std::string > &names) |
void | resetParameters_ () |
Parameter & | getParameter_ (const std::string &name) throw (ParameterNotFoundException) |
Parameter & | getParameter_ (size_t index) throw (IndexOutOfBoundsException) |
const Parameter & | getParameter_ (size_t index) const throw (IndexOutOfBoundsException) |
Parameter & | getParameterWithNamespace_ (const std::string &name) throw (ParameterNotFoundException) |
const Parameter & | getParameterWithNamespace_ (const std::string &name) const throw (ParameterNotFoundException) |
ParameterList & | getParameters_ () |
Protected Attributes | |
double | dLogLik_ |
std::string | dVariable_ |
double | d2LogLik_ |
std::string | d2Variable_ |
Private Attributes | |
std::auto_ptr< HmmStateAlphabet > | hiddenAlphabet_ |
The alphabet describing the hidden states. More... | |
std::auto_ptr< HmmTransitionMatrix > | transitionMatrix_ |
std::auto_ptr< HmmEmissionProbabilities > | emissionProbabilities_ |
std::vector< double > | likelihood_ |
The likelihood arrays. More... | |
std::vector< std::vector< double > > | dLikelihood_ |
derivatec of forward likelihood More... | |
std::vector< std::vector< double > > | d2Likelihood_ |
std::vector< std::vector< double > > | backLikelihood_ |
backward likelihood More... | |
bool | backLikelihoodUpToDate_ |
std::vector< double > | scales_ |
scales for likelihood computing More... | |
std::vector< double > | dScales_ |
std::vector< double > | d2Scales_ |
double | logLik_ |
std::vector< size_t > | breakPoints_ |
size_t | nbStates_ |
size_t | nbSites_ |
A simple implementation of hidden Markov models recursion.
This implementation uses the rescaling method described in Durbin et al "Biological sequence analysis", Cambridge University Press. It also offer the possibility to specify "breakpoints", where the chain will be reset to the equilibrium frequencies.
Definition at line 59 of file RescaledHmmLikelihood.h.
RescaledHmmLikelihood::RescaledHmmLikelihood | ( | HmmStateAlphabet * | hiddenAlphabet, |
HmmTransitionMatrix * | transitionMatrix, | ||
HmmEmissionProbabilities * | emissionProbabilities, | ||
const std::string & | prefix | ||
) | |||
throw | ( | Exception | |
) |
Build a new RescaledHmmLikelihood object.
Definition at line 50 of file RescaledHmmLikelihood.cpp.
Referenced by clone().
|
inline |
Definition at line 137 of file RescaledHmmLikelihood.h.
References emissionProbabilities_, hiddenAlphabet_, and transitionMatrix_.
|
inlinevirtual |
Definition at line 187 of file RescaledHmmLikelihood.h.
|
inlineprotectedinherited |
Definition at line 137 of file AbstractParametrizable.h.
References bpp::ParameterList::addParameter(), and bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::addParameter_(), bpp::AutoCorrelationTransitionMatrix::AutoCorrelationTransitionMatrix(), bpp::FullHmmTransitionMatrix::FullHmmTransitionMatrix(), and bpp::TestFunction::TestFunction().
|
inlineprotectedinherited |
Definition at line 143 of file AbstractParametrizable.h.
References bpp::ParameterList::addParameters(), and bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::addParameters_().
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::HmmLikelihood.
Definition at line 194 of file RescaledHmmLikelihood.h.
References RescaledHmmLikelihood().
|
protected |
Definition at line 240 of file RescaledHmmLikelihood.cpp.
|
protected |
Definition at line 474 of file RescaledHmmLikelihood.cpp.
References bpp::VectorTools::sum().
Referenced by computeD2Likelihood_().
|
inlineprotectedvirtual |
Implements bpp::HmmLikelihood.
Definition at line 244 of file RescaledHmmLikelihood.h.
References computeD2Forward_().
|
protected |
Definition at line 375 of file RescaledHmmLikelihood.cpp.
References bpp::VectorTools::sum().
Referenced by computeDLikelihood_().
|
inlineprotectedvirtual |
Implements bpp::HmmLikelihood.
Definition at line 239 of file RescaledHmmLikelihood.h.
References computeDForward_().
|
protected |
Definition at line 114 of file RescaledHmmLikelihood.cpp.
References bpp::TextTools::toString(), and bpp::ApplicationTools::warning.
Referenced by setBreakPoints().
|
inlinevirtualinherited |
Get the value of the second order derivative of the function according to a given set of parameters.
variable | The name of the ![]() ![]() |
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Definition at line 236 of file Functions.h.
References bpp::DerivableSecondOrder::getSecondOrderDerivative(), and bpp::Function::setParameters().
|
inlinevirtualinherited |
Get the value of the cross derivative of the function according to a given set of parameters.
variable1 | The name of the ![]() ![]() |
variable2 | The name of the ![]() ![]() |
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Definition at line 263 of file Functions.h.
References bpp::DerivableSecondOrder::getSecondOrderDerivative(), and bpp::Function::setParameters().
|
inlineprotectedinherited |
Definition at line 148 of file AbstractParametrizable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
Referenced by bpp::AbstractParameterAliasable::deleteParameter_().
|
inlineprotectedinherited |
Definition at line 155 of file AbstractParametrizable.h.
References bpp::ParameterList::deleteParameter(), and bpp::AbstractParametrizable::parameters_.
|
inlineprotectedinherited |
Definition at line 160 of file AbstractParametrizable.h.
References bpp::ParameterList::deleteParameters(), and bpp::AbstractParametrizable::parameters_.
|
inlinevirtualinherited |
Get the value of the first derivative of the function according to a given set of parameters.
variable | The name of the ![]() ![]() |
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Definition at line 176 of file Functions.h.
References bpp::DerivableFirstOrder::getFirstOrderDerivative(), and bpp::Function::setParameters().
|
inlinevirtualinherited |
Tell if derivatives must be computed.
yn | yes/no |
Implements bpp::DerivableFirstOrder.
Definition at line 163 of file HmmLikelihood.h.
|
inlinevirtualinherited |
Tell if derivatives must be computed.
Implements bpp::DerivableFirstOrder.
Definition at line 165 of file HmmLikelihood.h.
|
inlinevirtualinherited |
Tell if derivatives must be computed.
yn | yes/no |
Implements bpp::DerivableSecondOrder.
Definition at line 185 of file HmmLikelihood.h.
|
inlinevirtualinherited |
Tell if derivatives must be computed.
Implements bpp::DerivableSecondOrder.
Definition at line 187 of file HmmLikelihood.h.
|
inlinevirtualinherited |
Get the value of the function according to a given set of parameters.
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Reimplemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 117 of file Functions.h.
References bpp::Function::getValue(), and bpp::Function::setParameters().
Referenced by bpp::NewtonOneDimension::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), bpp::DownhillSimplexMethod::doStep(), bpp::FunctionWrapper::f(), bpp::PowellMultiDimensions::optimize(), bpp::BrentOneDimension::optimize(), bpp::DownhillSimplexMethod::optimize(), bpp::AbstractOptimizer::step(), and bpp::DownhillSimplexMethod::tryExtrapolation().
|
virtual |
Notify the class when one or several parameters have changed.
parameters | A ParameterList object with parameters that changed. |
Implements bpp::AbstractParametrizable.
Definition at line 97 of file RescaledHmmLikelihood.cpp.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 212 of file RescaledHmmLikelihood.h.
References breakPoints_.
|
inlinevirtualinherited |
Implements bpp::HmmLikelihood.
Definition at line 191 of file HmmLikelihood.h.
References bpp::AbstractHmmLikelihood::d2LogLik_.
|
inlinevirtualinherited |
Implements bpp::HmmLikelihood.
Definition at line 169 of file HmmLikelihood.h.
References bpp::AbstractHmmLikelihood::dLogLik_.
|
virtualinherited |
Get the derivative of the function at the current point.
variable | The name of the ![]() ![]() |
Exception | If no point is specified or if an error occured. |
Implements bpp::DerivableFirstOrder.
Definition at line 68 of file HmmLikelihood.cpp.
|
virtual |
Implements bpp::HmmLikelihood.
Definition at line 351 of file RescaledHmmLikelihood.cpp.
|
virtual |
Implements bpp::HmmLikelihood.
Definition at line 335 of file RescaledHmmLikelihood.cpp.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 203 of file RescaledHmmLikelihood.h.
References emissionProbabilities_.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 204 of file RescaledHmmLikelihood.h.
References emissionProbabilities_.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 197 of file RescaledHmmLikelihood.h.
References hiddenAlphabet_.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 198 of file RescaledHmmLikelihood.h.
References hiddenAlphabet_.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 200 of file RescaledHmmLikelihood.h.
References transitionMatrix_.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 201 of file RescaledHmmLikelihood.h.
References transitionMatrix_.
|
virtual |
Get the likelihood for a site.
site | The site index to analyse. |
Implements bpp::HmmLikelihood.
Definition at line 307 of file RescaledHmmLikelihood.cpp.
|
virtual |
Get the likelihood for each site.
Implements bpp::HmmLikelihood.
Definition at line 317 of file RescaledHmmLikelihood.cpp.
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 221 of file RescaledHmmLikelihood.h.
References logLik_.
|
inlinevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 125 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::prefix_.
Referenced by bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::Simplex::setFrequencies(), bpp::AbstractParameterAliasable::setNamespace(), and bpp::BppODiscreteDistributionFormat::write().
|
pure virtualinherited |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getNamespace().
|
inlinevirtualinherited |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 121 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), 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::FunctionWrapper::getNumberOfParameters(), and bpp::BppODiscreteDistributionFormat::write().
|
inlinevirtualinherited |
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 79 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
Referenced by bpp::AbstractParameterAliasable::getAliasedParameters(), bpp::ReparametrizationDerivableFirstOrderWrapper::getFirstOrderDerivative(), bpp::AbstractParametrizable::getParameterValue(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::ReparametrizationDerivableSecondOrderWrapper::getSecondOrderDerivative(), and bpp::TestFunction::getValue().
|
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::FunctionWrapper::getParameter().
|
inlineprotectedinherited |
name | The name of the parameter. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 175 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
Referenced by bpp::AbstractParameterAliasable::deleteParameter_(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), and bpp::InvariantMixedDiscreteDistribution::restrictToConstraint().
|
inlineprotectedinherited |
Definition at line 199 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
|
inlineprotectedinherited |
Definition at line 205 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
|
virtualinherited |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 63 of file AbstractParametrizable.cpp.
References bpp::TextTools::startsWith().
|
pure virtualinherited |
Resolves a parameter name according to the current namespace.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getParameterNameWithoutNamespace(), bpp::BppODiscreteDistributionFormat::read(), and bpp::BppOParametrizableFormat::write().
|
inlinevirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 77 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::AbstractParameterAliasable::fireParameterChanged(), 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::NewtonOneDimension::doStep(), bpp::FunctionWrapper::getParameters(), bpp::BppODiscreteDistributionFormat::read(), bpp::AbstractNumericalDerivative::setParameterValue(), bpp::AbstractOptimizer::step(), and bpp::BppOParametrizableFormat::write().
|
inlineprotectedinherited |
Definition at line 212 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), and bpp::AbstractParameterAliasable::operator=().
|
inlinevirtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 84 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter(), and bpp::Parameter::getValue().
Referenced by bpp::DirichletDiscreteDistribution::applyParameters(), bpp::ConstantDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::AutoCorrelationTransitionMatrix::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::FullHmmTransitionMatrix::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::Simplex::fireParameterChanged(), bpp::GammaDiscreteDistribution::randC(), bpp::ExponentialDiscreteDistribution::randC(), bpp::BetaDiscreteDistribution::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::FunctionWrapper::getParameterValue(), and bpp::BppODiscreteDistributionFormat::read().
|
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::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 194 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter().
|
virtualinherited |
Get the second order derivative of the function at the current point.
variable | The name of the ![]() ![]() |
Exception | If no point is specified or if an error occured. |
Implements bpp::DerivableSecondOrder.
Definition at line 80 of file HmmLikelihood.cpp.
|
inlinevirtualinherited |
Get the value of the cross derivative of the function according to a given set of parameters.
variable1 | The name of the ![]() ![]() |
variable2 | The name of the ![]() ![]() |
Exception | If an error occured. |
Implements bpp::DerivableSecondOrder.
Definition at line 196 of file HmmLikelihood.h.
|
inlinevirtual |
Get the value of the function at the current point.
Exception | If no point is specified or if an error occured. |
Implements bpp::Function.
Definition at line 219 of file RescaledHmmLikelihood.h.
References logLik_.
|
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::FunctionWrapper::hasParameter().
|
inlinevirtualinherited |
Tell if there is a parameter with specified name.
name | The name of the parameter to look for. |
Implements bpp::Parametrizable.
Definition at line 75 of file AbstractParametrizable.h.
References bpp::ParameterList::hasParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
|
inlinevirtualinherited |
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 111 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), and bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::Simplex::setFrequencies(), bpp::ReparametrizationFunctionWrapper::setParameters(), bpp::TestFunction::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::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::AbstractNumericalDerivative::matchParametersValues(), bpp::FunctionWrapper::matchParametersValues(), and bpp::InfinityFunctionWrapper::matchParametersValues().
|
inline |
Definition at line 161 of file RescaledHmmLikelihood.h.
References backLikelihood_, backLikelihoodUpToDate_, breakPoints_, d2Likelihood_, d2Scales_, dLikelihood_, dScales_, emissionProbabilities_, hiddenAlphabet_, likelihood_, logLik_, nbSites_, nbStates_, bpp::AbstractHmmLikelihood::operator=(), scales_, and transitionMatrix_.
|
inlineprotectedinherited |
Definition at line 165 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::reset().
Referenced by bpp::AbstractParameterAliasable::resetParameters_().
|
inlinevirtualinherited |
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 90 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, 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::AbstractNumericalDerivative::setAllParametersValues(), bpp::FunctionWrapper::setAllParametersValues(), and bpp::InfinityFunctionWrapper::setAllParametersValues().
|
inlinevirtual |
Implements bpp::HmmLikelihood.
Definition at line 206 of file RescaledHmmLikelihood.h.
References backLikelihoodUpToDate_, breakPoints_, and computeForward_().
|
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 45 of file AbstractParametrizable.cpp.
References bpp::TextTools::startsWith().
Referenced by bpp::AbstractParameterAliasable::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::AbstractParameterAliasable, bpp::MixtureOfDiscreteDistributions, bpp::AbstractParametrizable, and bpp::InvariantMixedDiscreteDistribution.
Referenced by bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), bpp::InvariantMixedDiscreteDistribution::setNamespace(), and bpp::FunctionWrapper::setNamespace().
|
inlinevirtual |
Set the point where the function must be computed.
parameters | The parameter set to pass to the function. |
Implements bpp::Function.
Definition at line 214 of file RescaledHmmLikelihood.h.
References bpp::AbstractParametrizable::setParametersValues().
|
inlinevirtualinherited |
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 104 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::setParametersValues().
Referenced by bpp::LowMemoryRescaledHmmLikelihood::setParameters(), bpp::LogsumHmmLikelihood::setParameters(), and 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::AbstractNumericalDerivative::setParametersValues(), bpp::FunctionWrapper::setParametersValues(), and bpp::InfinityFunctionWrapper::setParametersValues().
|
inlinevirtualinherited |
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 97 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, bpp::AbstractParametrizable::prefix_, bpp::ParameterList::setParameterValue(), and bpp::ParameterList::subList().
|
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::AbstractNumericalDerivative::setParameterValue(), bpp::FunctionWrapper::setParameterValue(), and bpp::InfinityFunctionWrapper::setParameterValue().
|
mutableprivate |
backward likelihood
backLikelihood_[i][j] corresponds to Pr(x_i+1...x_n | yi=j), where the x are the observed states, and y the hidden states.
Definition at line 102 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
mutableprivate |
Definition at line 103 of file RescaledHmmLikelihood.h.
Referenced by operator=(), and setBreakPoints().
|
private |
Definition at line 118 of file RescaledHmmLikelihood.h.
Referenced by getBreakPoints(), operator=(), and setBreakPoints().
|
mutableprivate |
Definition at line 93 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
mutableprotectedinherited |
Definition at line 147 of file HmmLikelihood.h.
Referenced by bpp::AbstractHmmLikelihood::getD2LogLikelihood(), and bpp::AbstractHmmLikelihood::operator=().
|
mutableprivate |
Definition at line 115 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
mutableprotectedinherited |
Definition at line 148 of file HmmLikelihood.h.
Referenced by bpp::AbstractHmmLikelihood::operator=().
|
mutableprivate |
derivatec of forward likelihood
dlikelihood_[i][j] corresponds to d(Pr(x_1...x_i, y_i=j))/Pr(x_1...x_i)), where the x are the observed states, and y the hidden states.
Definition at line 92 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
mutableprotectedinherited |
Definition at line 144 of file HmmLikelihood.h.
Referenced by bpp::AbstractHmmLikelihood::getDLogLikelihood(), and bpp::AbstractHmmLikelihood::operator=().
|
mutableprivate |
Definition at line 114 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
mutableprotectedinherited |
Definition at line 145 of file HmmLikelihood.h.
Referenced by bpp::AbstractHmmLikelihood::operator=().
|
private |
Definition at line 69 of file RescaledHmmLikelihood.h.
Referenced by getHmmEmissionProbabilities(), operator=(), and RescaledHmmLikelihood().
|
private |
The alphabet describing the hidden states.
Definition at line 67 of file RescaledHmmLikelihood.h.
Referenced by getHmmStateAlphabet(), operator=(), and RescaledHmmLikelihood().
|
private |
The likelihood arrays.
forward likelihood
likelihood_[i * nbStates_ + j] corresponds to Pr(x_1...x_i, y_i=j)/Pr(x_1...x_i), where the x are the observed states, and y the hidden states.
Definition at line 83 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
private |
Definition at line 116 of file RescaledHmmLikelihood.h.
Referenced by getLogLikelihood(), getValue(), and operator=().
|
private |
Definition at line 120 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
private |
Definition at line 120 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
private |
scales for likelihood computing
scales_[i * nbStates_ + j] corresponds to Pr(x_1...x_i)/Pr(x_1...x_{i-1}) where the x are the observed states.
Definition at line 112 of file RescaledHmmLikelihood.h.
Referenced by operator=().
|
private |
Definition at line 68 of file RescaledHmmLikelihood.h.
Referenced by getHmmTransitionMatrix(), operator=(), and RescaledHmmLikelihood().