1#ifndef STAN_MATH_PRIM_ERR_HMM_CHECK_HPP
2#define STAN_MATH_PRIM_ERR_HMM_CHECK_HPP
27template <
typename T_omega,
typename T_Gamma,
typename T_rho,
28 require_all_eigen_t<T_omega, T_Gamma>* =
nullptr,
29 require_eigen_col_vector_t<T_rho>* =
nullptr>
30inline void hmm_check(
const T_omega& log_omegas,
const T_Gamma& Gamma,
31 const T_rho& rho,
const char* function) {
32 int n_states = log_omegas.rows();
40 const auto& Gamma_ref =
to_ref(Gamma);
41 for (
int i = 0; i < Gamma.rows(); ++i) {
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
void check_multiplicable(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Check if the matrices can be multiplied.
void check_consistent_size(const char *function, const char *name, const T &x, size_t expected_size)
Check if x is consistent with size expected_size.
void hmm_check(const T_omega &log_omegas, const T_Gamma &Gamma, const T_rho &rho, const char *function)
Check arguments for hidden Markov model functions with a discrete latent state (lpdf,...
void check_simplex(const char *function, const char *name, const T &theta)
Throw an exception if the specified vector is not a simplex.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
void check_nonzero_size(const char *function, const char *name, const T_y &y)
Check if the specified matrix/vector is of non-zero size.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...