1#ifndef STAN_MATH_PRIM_PROB_INV_WISHART_LPDF_HPP
2#define STAN_MATH_PRIM_PROB_INV_WISHART_LPDF_HPP
44template <
bool propto,
typename T_y,
typename T_dof,
typename T_scale>
53 static constexpr const char* function =
"inv_wishart_lpdf";
55 "columns of scale parameter", S.rows());
58 Eigen::Index k = S.rows();
62 check_greater(function,
"Degrees of freedom parameter", nu_ref, k - 1);
91template <
typename T_y,
typename T_dof,
typename T_scale>
95 return inv_wishart_lpdf<false>(W, nu, S);
void check_symmetric(const char *function, const char *name, const matrix_cl< T > &y)
Check if the matrix_cl is symmetric.
return_type_t< T_y, T_dof, T_scale > inv_wishart_lpdf(const T_y &W, const T_dof &nu, const T_scale &S)
The log of the Inverse-Wishart density for the given W, degrees of freedom, and scale matrix.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
static constexpr double HALF_LOG_TWO
The value of half the natural logarithm 2, .
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>
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
value_type_t< T > trace(const T &m)
Calculates trace (sum of diagonal) of given kernel generator expression.
Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, EigMat::ColsAtCompileTime > mdivide_left_ldlt(LDLT_factor< T > &A, const EigMat &b)
Returns the solution of the system Ax=b given an LDLT_factor of A.
fvar< return_type_t< T, int > > lmgamma(int x1, const fvar< T > &x2)
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_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.
void check_greater(const char *function, const char *name, const T_y &y, const T_low &low, Idxs... idxs)
Throw an exception if y is not strictly greater than low.
typename ref_type_if< true, T >::type ref_type_t
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...