1 #ifndef STAN_MATH_PRIM_MAT_FUN_CHOLESKY_CORR_FREE_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_CHOLESKY_CORR_FREE_HPP 15 const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& x) {
23 int K = (x.rows() * (x.rows() - 1)) / 2;
24 Matrix<T, Dynamic, 1> z(K);
26 for (
int i = 1; i < x.rows(); ++i) {
28 double sum_sqs =
square(x(i, 0));
29 for (
int j = 1; j < i; ++j) {
31 sum_sqs +=
square(x(i, j));
Eigen::Matrix< T, Eigen::Dynamic, 1 > cholesky_corr_free(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x)
fvar< T > sqrt(const fvar< T > &x)
void check_square(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is square.
fvar< T > square(const fvar< T > &x)
T corr_free(const T &y)
Return the unconstrained scalar that when transformed to a valid correlation produces the specified v...