1#ifndef STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_FREE_LKJ_HPP
2#define STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_FREE_LKJ_HPP
30template <
typename T, require_eigen_t<T>* =
nullptr>
40 Eigen::Index k = y.rows();
41 Eigen::Index k_choose_2 = (k * (k - 1)) / 2;
42 Matrix<T_scalar, Dynamic, 1> x(k_choose_2 + k);
59template <
typename T, require_std_vector_t<T>* =
nullptr>
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
void throw_domain_error(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
void check_nonzero_size(const char *function, const char *name, const T_y &y)
Check if the specified matrix/vector is of non-zero size.
Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, 1 > cov_matrix_free_lkj(const T &y)
Return the vector of unconstrained partial correlations and deviations that transform to the specifie...
bool factor_cov_matrix(const T_Sigma &Sigma, T_CPCs &&CPCs, T_sds &&sds)
This function is intended to make starting values, given a covariance matrix Sigma.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...