5 #ifndef BPP_NUMERIC_HMM_HMMLIKELIHOOD_H 6 #define BPP_NUMERIC_HMM_HMMLIKELIHOOD_H 10 #include "../Function/Functions.h" 11 #include "../VectorTools.h" 96 virtual void setBreakPoints(
const std::vector<size_t>& breakPoints) = 0;
165 throw (
NotImplementedException(
"AbstractHmmLikelihood::getSecondOrderDerivative is not defined for 2 variables."));
173 #endif // BPP_NUMERIC_HMM_HMMLIKELIHOOD_H virtual double getD2LogLikelihoodForASite(size_t site) const =0
virtual const std::vector< size_t > & getBreakPoints() const =0
virtual double getLogLikelihood() const =0
double getDLogLikelihood() const
virtual const HmmStateAlphabet & hmmStateAlphabet() const =0
virtual double getDLogLikelihoodForASite(size_t site) const =0
virtual double getDLogLikelihood() const =0
Interface for computing emission probabilities in a Hidden Markov Model.
virtual const HmmTransitionMatrix & hmmTransitionMatrix() const =0
void enableSecondOrderDerivatives(bool yn)
From SecondOrder:
void enableFirstOrderDerivatives(bool yn)
From FirstOrder:
virtual std::shared_ptr< const HmmTransitionMatrix > getHmmTransitionMatrix() const =0
virtual void computeDLikelihood_() const =0
virtual void setBreakPoints(const std::vector< size_t > &breakPoints)=0
virtual double getFirstOrderDerivative(const std::string &variable) const =0
Get the derivative of the function at the current point.
double getD2LogLikelihood() const
This exception is sent when a given method is not implemented.
virtual double getSecondOrderDerivative(const std::string &variable) const =0
Get the second order derivative of the function at the current point.
bool enableFirstOrderDerivatives() const
Tell if derivatives must be computed.
virtual std::shared_ptr< const HmmStateAlphabet > getHmmStateAlphabet() const =0
virtual HmmLikelihood * clone() const =0
Create a copy of this object and send a pointer to it.
virtual double getD2LogLikelihood() const =0
std::vector< double > Vdouble
virtual double getLikelihoodForASite(size_t site) const =0
Get the likelihood for a site, and its derivatives.
virtual std::shared_ptr< const HmmEmissionProbabilities > getHmmEmissionProbabilities() const =0
partial impmementation of Hmm Likelihoods.
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const
Get the value of the cross derivative of the function according to a given set of parameters...
virtual Vdouble getLikelihoodForEachSite() const =0
Get the likelihood for each site.
virtual void getHiddenStatesPosteriorProbabilities(std::vector< std::vector< double >> &probs, bool append) const =0
virtual Vdouble getHiddenStatesPosteriorProbabilitiesForASite(size_t site) const =0
virtual void computeD2Likelihood_() const =0
bool enableSecondOrderDerivatives() const
Tell if derivatives must be computed.
Describe the transition probabilities between hidden states of a Hidden Markov Model.
Basal interface for Hidden Markov Models likelihood computation.
This is the abstract class for second order derivable functions.
virtual const HmmEmissionProbabilities & hmmEmissionProbabilities() const =0