1 #ifndef STAN_MATH_PRIM_MAT_FUN_CORR_MATRIX_CONSTRAIN_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_CORR_MATRIX_CONSTRAIN_HPP 39 Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
42 <Eigen::Matrix<T, Eigen::Dynamic, 1> >::type k) {
47 size_type k_choose_2 = (k * (k - 1)) / 2;
50 "k_choose_2", k_choose_2);
51 Eigen::Array<T, Eigen::Dynamic, 1> cpcs(k_choose_2);
52 for (size_type i = 0; i < k_choose_2; ++i)
77 Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
80 <Eigen::Matrix<T, Eigen::Dynamic, 1> >::type k,
87 size_type k_choose_2 = (k * (k - 1)) / 2;
90 "k_choose_2", k_choose_2);
91 Array<T, Dynamic, 1> cpcs(k_choose_2);
92 for (size_type i = 0; i < k_choose_2; ++i)
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > corr_matrix_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type k)
Return the correlation matrix of the specified dimensionality derived from the specified vector of un...
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
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.
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > read_corr_matrix(const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, size_t K)
Return the correlation matrix of the specified dimensionality corresponding to the specified canonica...
T corr_constrain(const T x)
Return the result of transforming the specified scalar to have a valid correlation value between -1 a...