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

◆ read_corr_matrix() [2/4]

template<typename T_CPCs , require_eigen_vector_t< T_CPCs > * = nullptr>
Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > stan::math::read_corr_matrix ( const T_CPCs &  CPCs,
size_t  K,
value_type_t< T_CPCs > &  log_prob 
)

Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation.

It is usually preferable to utilize the version that returns the Cholesky factor of the correlation matrix rather than the correlation matrix itself in statistical calculations.

Template Parameters
T_CPCstype of the array (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1)
Parameters
CPCsThe (K choose 2) canonical partial correlations in (-1, 1).
KDimensionality of correlation matrix.
log_probReference to variable to increment with the log Jacobian determinant.
Returns
Correlation matrix for specified partial correlations.

Definition at line 56 of file read_corr_matrix.hpp.