bpp-core3  3.0.0
AutoCorrelationTransitionMatrix.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_NUMERIC_HMM_AUTOCORRELATIONTRANSITIONMATRIX_H
6 #define BPP_NUMERIC_HMM_AUTOCORRELATIONTRANSITIONMATRIX_H
7 
8 
9 #include "../AbstractParameterAliasable.h"
11 
12 namespace bpp
13 {
26  public virtual AbstractHmmTransitionMatrix,
28 {
29 private:
30  std::vector<double> vAutocorrel_;
31 
32 public:
33  AutoCorrelationTransitionMatrix(std::shared_ptr<const HmmStateAlphabet> alph, const std::string& prefix = "");
34 
36 
38 
40 
48  double Pij(size_t i, size_t j) const override
49  {
50  return (i == j) ? vAutocorrel_[i] : (1 - vAutocorrel_[i]) / static_cast<double>(getNumberOfStates() - 1);
51  }
52 
58  const Matrix<double>& getPij() const override;
59 
63  const std::vector<double>& getEquilibriumFrequencies() const override;
64 
65 
66  /*
67  * @brief From AbstractParametrizable interface
68  *
69  */
70 
71  void fireParameterChanged(const ParameterList& parameters) override;
72 };
73 } // end of namespace bpp
74 #endif // BPP_NUMERIC_HMM_AUTOCORRELATIONTRANSITIONMATRIX_H
The matrix template interface.
Definition: Matrix.h:22
void fireParameterChanged(const ParameterList &parameters) override
Notify the class when one or several parameters have changed.
AutoCorrelationTransitionMatrix & operator=(const AutoCorrelationTransitionMatrix &hptm)
double Pij(size_t i, size_t j) const override
Get the transition probability between two states.
A partial implementation of the Parametrizable interface.
The parameter list object.
Definition: ParameterList.h:27
Partial implementation of HmmTransitionMatrix.
AutoCorrelationTransitionMatrix(std::shared_ptr< const HmmStateAlphabet > alph, const std::string &prefix="")
const Matrix< double > & getPij() const override
Get all transition probabilities as a matrix.
AutoCorrelationTransitionMatrix * clone() const override
Create a copy of this object and send a pointer to it.
const std::vector< double > & getEquilibriumFrequencies() const override
Describe the auto-correlation probabilities inside hidden states of a Hidden Markov Model...