All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
read_cov_L.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_MAT_FUN_READ_COV_L_HPP
#define STAN_MATH_PRIM_MAT_FUN_READ_COV_L_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
namespace stan {
namespace math {
template <typename T>
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
read_cov_L(const Eigen::Array<T, Eigen::Dynamic, 1>& CPCs,
const Eigen::Array<T, Eigen::Dynamic, 1>& sds,
T& log_prob) {
size_t K = sds.rows();
// adjust due to transformation from correlations to covariances
log_prob += (sds.log().sum() + stan::math::LOG_2) * K;
return sds.matrix().asDiagonal() * read_corr_L(CPCs, K, log_prob);
}
}
}
#endif
stan::math::LOG_2
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:33
stan::math::read_cov_L
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > read_cov_L(const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const Eigen::Array< T, Eigen::Dynamic, 1 > &sds, T &log_prob)
This is the function that should be called prior to evaluating the density of any elliptical distribu...
Definition: read_cov_L.hpp:23
Eigen.hpp
stan::math::read_corr_L
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > read_corr_L(const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const size_t K)
Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to...
Definition: read_corr_L.hpp:41
constants.hpp

[ Stan Home Page ] © 2011–2015, Stan Development Team.