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() [5/7]

template<bool Jacobian, typename T , typename Lp , require_convertible_t< return_type_t< T >, Lp > * = nullptr>
auto 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. 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 or standard vector thereof
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
[in,out]lplog density accumulator

Definition at line 145 of file corr_matrix_constrain.hpp.