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

◆ corr_matrix_constrain() [2/7]

template<typename T , typename Lp , require_eigen_col_vector_t< T > * = nullptr, require_convertible_t< return_type_t< T >, Lp > * = nullptr>
Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > stan::math::corr_matrix_constrain ( const T &  x,
Eigen::Index  k,
Lp &  lp 
)
inline

Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.

The input vector must be of length {k \choose 2} = \frac{k(k-1)}{2}. The values in the input vector represent unconstrained (partial) correlations among the dimensions.

The transform is as specified for corr_matrix_constrain(Matrix, size_t); the paper it cites also defines the Jacobians for correlation inputs, which are composed with the correlation constrained Jacobians defined in corr_constrain(T, double) for this function.

Template Parameters
Ttype of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1)
LpA scalar type for the lp argument. The scalar type of T should be convertable to this.
Parameters
xVector of unconstrained partial correlations.
kDimensionality of returned correlation matrix.
lpLog probability reference to increment.

Definition at line 73 of file corr_matrix_constrain.hpp.