ssmkit  master-68aed98
switching_additive_linear_gaussian.hpp
Go to the documentation of this file.
1 #ifndef SSMPACK_MODEL_SWITCHING_ADDITIVE_LINEAR_GAUSSIAN_HPP
2 #define SSMPACK_MODEL_SWITCHING_ADDITIVE_LINEAR_GAUSSIAN_HPP
3 
4 #include <armadillo>
5 
6 namespace ssmkit {
7 namespace map {
8 
10  using TParameter = std::tuple<arma::vec, arma::mat>;
11  using TConditionVAR = arma::vec;
12 
13  SwitchingAdditiveLinearGaussian(arma::mat trans, arma::mat cov, arma::mat b)
14  : biases{b}, transfer{trans}, covariance{cov} {}
15  // should not be overloaded, should not be template
16  TParameter operator()(const TConditionVAR &x, const int &k) const {
17  return std::make_tuple(transfer * x + biases.col(k), covariance);
18  }
19 
20  arma::mat biases;
21  arma::mat transfer;
22  arma::mat covariance;
23 };
24 
25 
26 } // namespace map
27 } // namespace ssmkit
28 
29 #endif // SSMPACK_MODEL_SWITCHING_ADDITIVE_LINEAR_GAUSSIAN_HPP
SwitchingAdditiveLinearGaussian(arma::mat trans, arma::mat cov, arma::mat b)
TParameter operator()(const TConditionVAR &x, const int &k) const