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

◆ corr_matrix_constrain() [6/6]

template<typename T , require_var_vector_t< T > * = nullptr>
var_value< Eigen::MatrixXd > stan::math::corr_matrix_constrain ( const T &  x,
Eigen::Index  k,
scalar_type_t< T > &  lp 
)

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 input vector (must be a var_value<S> where S inherits from EigenBase)
Parameters
xVector of unconstrained partial correlations.
kDimensionality of returned correlation matrix.
lpLog probability reference to increment.

Definition at line 69 of file corr_matrix_constrain.hpp.