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

◆ corr_matrix_constrain() [3/6]

template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr>
auto stan::math::corr_matrix_constrain ( const T &  x,
Eigen::Index  k,
return_type_t< T > &  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. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.

Template Parameters
Jacobianif true, increment log density accumulator with log absolute Jacobian determinant of constraining transform
TA type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column
Parameters
xVector of unconstrained partial correlations
kDimensionality of returned correlation matrix
[in,out]lplog density accumulator

Definition at line 97 of file corr_matrix_constrain.hpp.