1 #ifndef STAN_MATH_PRIM_MAT_FUN_COV_MATRIX_FREE_LKJ_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_COV_MATRIX_FREE_LKJ_HPP
32 Eigen::Matrix<T, Eigen::Dynamic, 1>
34 const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& y) {
42 size_type k = y.rows();
43 size_type k_choose_2 = (k * (k-1)) / 2;
44 Array<T, Dynamic, 1> cpcs(k_choose_2);
45 Array<T, Dynamic, 1> sds(k);
49 "factor_cov_matrix failed on y",
"",
"");
50 Matrix<T, Dynamic, 1> x(k_choose_2 + k);
52 for (size_type i = 0; i < k_choose_2; ++i)
54 for (size_type i = 0; i < k; ++i)
bool check_nonzero_size(const char *function, const char *name, const T_y &y)
Return true if the specified matrix/vector is of non-zero size.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
Primary template class for the metaprogram to compute the index type of a container.
bool factor_cov_matrix(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &Sigma, Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, Eigen::Array< T, Eigen::Dynamic, 1 > &sds)
This function is intended to make starting values, given a covariance matrix Sigma.
Eigen::Matrix< T, Eigen::Dynamic, 1 > cov_matrix_free_lkj(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y)
Return the vector of unconstrained partial correlations and deviations that transform to the specifie...
void 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.
bool check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.