1 #ifndef STAN_MATH_PRIM_MAT_PROB_INV_WISHART_RNG_HPP 2 #define STAN_MATH_PRIM_MAT_PROB_INV_WISHART_RNG_HPP 16 static const char*
function =
"inv_wishart_rng";
18 using Eigen::MatrixXd;
21 check_greater(
function,
"degrees of freedom > dims - 1", nu, k - 1);
24 MatrixXd S_inv = MatrixXd::Identity(k, k);
25 S_inv = S.ldlt().solve(S_inv);
27 return 0.5 * (asym.transpose() + asym);
Eigen::MatrixXd wishart_rng(double nu, const Eigen::MatrixXd &S, RNG &rng)
void check_square(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is square.
Primary template class for the metaprogram to compute the index type of a container.
Eigen::MatrixXd inv_wishart_rng(double nu, const Eigen::MatrixXd &S, RNG &rng)
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > inverse_spd(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
Returns the inverse of the specified symmetric, pos/neg-definite matrix.
void check_greater(const char *function, const char *name, const T_y &y, const T_low &low)
Check if y is strictly greater than low.