Loading [MathJax]/extensions/TeX/AMSmath.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ read_corr_matrix() [2/4]

template<typename T_CPCs , typename Lp , require_eigen_vector_t< T_CPCs > * = nullptr, require_convertible_t< value_type_t< T_CPCs >, Lp > * = nullptr>
Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > stan::math::read_corr_matrix ( const T_CPCs &  CPCs,
size_t  K,
Lp &  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)
LpA scalar type for the lp argument. The scalar type of T_CPCs should be convertable to this.
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 60 of file read_corr_matrix.hpp.