1#ifndef STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_FREE_HPP
2#define STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_FREE_HPP
33template <
typename T, require_eigen_t<T>* =
nullptr>
41 Eigen::Index k = y.rows();
42 Eigen::Index k_choose_2 = (k * (k - 1)) / 2;
43 Eigen::Matrix<value_type_t<T>, Dynamic, 1> x(k_choose_2);
44 Array<value_type_t<T>, Dynamic, 1> sds(k);
62template <
typename T, require_std_vector_t<T>* =
nullptr>
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, 1 > corr_matrix_free(const T &y)
Return the vector of unconstrained partial correlations that define the specified correlation matrix ...
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.
const double CONSTRAINT_TOLERANCE
The tolerance for checking arithmetic bounds in rank and in simplexes.
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 ...