Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ corr_matrix_free() [1/2]

template<typename T , require_eigen_t< T > * = nullptr>
Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, 1 > stan::math::corr_matrix_free ( const T &  y)

Return the vector of unconstrained partial correlations that define the specified correlation matrix when transformed.

The constraining transform is defined as for corr_matrix_constrain(Matrix, size_t). The inverse transform in this function is simpler in that it only needs to compute the \(k \choose 2\) partial correlations and then free those.

Template Parameters
Ttype of the matrix (must be derived from Eigen::MatrixBase)
Parameters
yThe correlation matrix to free.
Returns
Vector of unconstrained values that produce the specified correlation matrix when transformed.
Exceptions
std::domain_errorif the correlation matrix has no elements or is not a square matrix.
std::runtime_errorif the correlation matrix cannot be factorized by factor_cov_matrix() or if the sds returned by factor_cov_matrix() on log scale are unconstrained.

Definition at line 34 of file corr_matrix_free.hpp.