1#ifndef STAN_MATH_PRIM_PROB_MATRIX_NORMAL_PREC_LPDF_HPP
2#define STAN_MATH_PRIM_PROB_MATRIX_NORMAL_PREC_LPDF_HPP
33template <
bool propto,
typename T_y,
typename T_Mu,
typename T_Sigma,
35 require_all_matrix_t<T_y, T_Mu, T_Sigma, T_D>* =
nullptr>
37 const T_y& y,
const T_Mu& Mu,
const T_Sigma& Sigma,
const T_D& D) {
38 static constexpr const char* function =
"matrix_normal_prec_lpdf";
52 "Rows of location parameter", Mu.rows());
54 "Columns of location parameter", Mu.cols());
56 "Rows of Sigma", Sigma.rows());
58 "Rows of D", D.rows());
82template <
typename T_y,
typename T_Mu,
typename T_Sigma,
typename T_D,
85 const T_y& y,
const T_Mu& Mu,
const T_Sigma& Sigma,
const T_D& D) {
86 return matrix_normal_prec_lpdf<false>(y, Mu, Sigma, D);
void check_symmetric(const char *function, const char *name, const matrix_cl< T > &y)
Check if the matrix_cl is symmetric.
require_all_t< is_matrix< std::decay_t< Types > >... > require_all_matrix_t
Require all of the types satisfy is_matrix.
return_type_t< T_y, T_Mu, T_Sigma, T_D > matrix_normal_prec_lpdf(const T_y &y, const T_Mu &Mu, const T_Sigma &Sigma, const T_D &D)
The log of the matrix normal density for the given y, mu, Sigma and D where Sigma and D are given as ...
subtraction_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > subtract(T_a &&a, T_b &&b)
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
value_type_t< T > log_determinant_ldlt(LDLT_factor< T > &A)
Returns log(abs(det(A))) given a LDLT_factor of A.
auto make_ldlt_factor(const T &A)
Make an LDLT_factor with matrix type plain_type_t<T>
const double NEG_LOG_SQRT_TWO_PI
The value of minus the natural logarithm of the square root of , .
auto trace_gen_quad_form(const TD &D, const TA &A, const TB &B)
Return the trace of D times the quadratic form of B and A.
void check_finite(const char *function, const char *name, const T_y &y)
Return true if all values in y are finite.
void check_ldlt_factor(const char *function, const char *name, LDLT_factor< T > &A)
Raise domain error if the specified LDLT factor is invalid.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Template metaprogram to calculate whether a summand needs to be included in a proportional (log) prob...