1#ifndef STAN_MATH_PRIM_PROB_INV_WISHART_CHOLESKY_RNG_HPP
2#define STAN_MATH_PRIM_PROB_INV_WISHART_CHOLESKY_RNG_HPP
32 const Eigen::MatrixXd& L_S,
34 using Eigen::MatrixXd;
35 static constexpr const char* function =
"inv_wishart_cholesky_rng";
38 check_greater(function,
"degrees of freedom > dims - 1", nu, k - 1);
41 MatrixXd B = MatrixXd::Zero(k, k);
42 for (
int j = 0; j < k; ++j) {
43 for (
int i = 0; i < j; ++i) {
Eigen::MatrixXd inv_wishart_cholesky_rng(double nu, const Eigen::MatrixXd &L_S, RNG &rng)
Return a random Cholesky factor of a covariance matrix of the specified dimensionality drawn from the...
VectorBuilder< true, double, T_loc, T_scale >::type normal_rng(const T_loc &mu, const T_scale &sigma, RNG &rng)
Return a Normal random variate for the given location and scale using the specified random number gen...
VectorBuilder< true, double, T_deg >::type chi_square_rng(const T_deg &nu, RNG &rng)
Return a chi squared random variate with nu degrees of freedom using the specified random number gene...
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
typename index_type< T >::type index_type_t
Eigen::Matrix< value_type_t< EigMat1 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > mdivide_right_tri_low(const EigMat1 &A, const EigMat2 &b)
void check_cholesky_factor(const char *function, const char *name, const Mat &y)
Throw an exception if the specified matrix is not a valid Cholesky factor.
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.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...