Stan Math Library
2.20.0
reverse mode automatic differentiation
stan
math
prim
mat
prob
lkj_corr_rng.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_MAT_PROB_LKJ_CORR_RNG_HPP
2
#define STAN_MATH_PRIM_MAT_PROB_LKJ_CORR_RNG_HPP
3
4
#include <
stan/math/prim/meta.hpp
>
5
#include <
stan/math/prim/mat/fun/multiply_lower_tri_self_transpose.hpp
>
6
#include <
stan/math/prim/mat/prob/lkj_corr_cholesky_rng.hpp
>
7
#include <
stan/math/prim/scal/err/check_positive.hpp
>
8
9
namespace
stan
{
10
namespace
math {
11
25
template
<
class
RNG>
26
inline
Eigen::MatrixXd
lkj_corr_rng
(
size_t
K,
double
eta, RNG& rng) {
27
static
const
char
*
function
=
"lkj_corr_rng"
;
28
check_positive
(
function
,
"Shape parameter"
, eta);
29
return
multiply_lower_tri_self_transpose
(
lkj_corr_cholesky_rng
(K, eta, rng));
30
}
31
32
}
// namespace math
33
}
// namespace stan
34
#endif
multiply_lower_tri_self_transpose.hpp
check_positive.hpp
stan
Definition:
log_sum_exp.hpp:8
meta.hpp
stan::math::multiply_lower_tri_self_transpose
Eigen::Matrix< fvar< T >, R, R > multiply_lower_tri_self_transpose(const Eigen::Matrix< fvar< T >, R, C > &m)
Definition:
multiply_lower_tri_self_transpose.hpp:13
stan::math::lkj_corr_rng
Eigen::MatrixXd lkj_corr_rng(size_t K, double eta, RNG &rng)
Return a random correlation matrix (symmetric, positive definite, unit diagonal) of the specified dim...
Definition:
lkj_corr_rng.hpp:26
stan::math::lkj_corr_cholesky_rng
Eigen::MatrixXd lkj_corr_cholesky_rng(size_t K, double eta, RNG &rng)
Definition:
lkj_corr_cholesky_rng.hpp:13
stan::math::check_positive
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
Definition:
check_positive.hpp:52
lkj_corr_cholesky_rng.hpp
[
Stan Home Page
]
© 2011–2018, Stan Development Team.