12 #ifndef MLPACK_METHODS_HMM_HMM_REGRESSION_HPP 13 #define MLPACK_METHODS_HMM_HMM_REGRESSION_HPP 91 const double tolerance = 1e-5) :
92 HMM<distribution::RegressionDistribution>(states, emissions, tolerance)
120 const arma::mat& transition,
121 const std::vector<distribution::RegressionDistribution>&
emission,
122 const double tolerance = 1e-5) :
123 HMM<distribution::RegressionDistribution>(initial, transition, emission,
157 void Train(
const std::vector<arma::mat>& predictors,
158 const std::vector<arma::vec>& responses);
178 void Train(
const std::vector<arma::mat>& predictors,
179 const std::vector<arma::vec>& responses,
180 const std::vector<arma::Row<size_t> >& stateSeq);
201 double Estimate(
const arma::mat& predictors,
202 const arma::vec& responses,
203 arma::mat& stateProb,
204 arma::mat& forwardProb,
205 arma::mat& backwardProb,
206 arma::vec& scales)
const;
220 double Estimate(
const arma::mat& predictors,
221 const arma::vec& responses,
222 arma::mat& stateProb)
const;
235 double Predict(
const arma::mat& predictors,
236 const arma::vec& responses,
237 arma::Row<size_t>& stateSeq)
const;
247 const arma::vec& responses)
const;
261 void Filter(
const arma::mat& predictors,
262 const arma::vec& responses,
263 arma::vec& filterSeq,
264 size_t ahead = 0)
const;
278 void Smooth(
const arma::mat& predictors,
279 const arma::vec& responses,
280 arma::vec& smoothSeq)
const;
286 void StackData(
const std::vector<arma::mat>& predictors,
287 const std::vector<arma::vec>& responses,
288 std::vector<arma::mat>& dataSeq)
const;
290 void StackData(
const arma::mat& predictors,
291 const arma::vec& responses,
292 arma::mat& dataSeq)
const;
305 void Forward(
const arma::mat& predictors,
306 const arma::vec& responses,
308 arma::mat& forwardProb)
const;
322 void Backward(
const arma::mat& predictors,
323 const arma::vec& responses,
324 const arma::vec& scales,
325 arma::mat& backwardProb)
const;
332 #include "hmm_regression_impl.hpp" void Filter(const arma::mat &predictors, const arma::vec &responses, arma::vec &filterSeq, size_t ahead=0) const
HMMR filtering.
std::vector< distribution::RegressionDistribution > emission
Set of emission probability distributions; one for each state.
Linear algebra utility functions, generally performed on matrices or vectors.
double Predict(const arma::mat &predictors, const arma::vec &responses, arma::Row< size_t > &stateSeq) const
Compute the most probable hidden state sequence for the given predictors and responses, using the Viterbi algorithm, returning the log-likelihood of the most likely state sequence.
The core includes that mlpack expects; standard C++ includes and Armadillo.
A class that represents a Hidden Markov Model Regression (HMMR).
double Estimate(const arma::mat &predictors, const arma::vec &responses, arma::mat &stateProb, arma::mat &forwardProb, arma::mat &backwardProb, arma::vec &scales) const
Estimate the probabilities of each hidden state at each time step for each given data observation...
void Smooth(const arma::mat &predictors, const arma::vec &responses, arma::vec &smoothSeq) const
HMM smoothing.
A class that represents a univariate conditionally Gaussian distribution.
A class that represents a Hidden Markov Model with an arbitrary type of emission distribution.
HMMRegression(const arma::vec &initial, const arma::mat &transition, const std::vector< distribution::RegressionDistribution > &emission, const double tolerance=1e-5)
Create the Hidden Markov Model Regression with the given initial probability vector, the given transition matrix, and the given regression emission distributions.
void Train(const std::vector< arma::mat > &predictors, const std::vector< arma::vec > &responses)
Train the model using the Baum-Welch algorithm, with only the given predictors and responses...
double LogLikelihood(const arma::mat &predictors, const arma::vec &responses) const
Compute the log-likelihood of the given predictors and responses.
HMMRegression(const size_t states, const distribution::RegressionDistribution emissions, const double tolerance=1e-5)
Create the Hidden Markov Model Regression with the given number of hidden states and the given defaul...