1 #ifndef __STAN__PROB__DISTRIBUTIONS__MULTIVARIATE__CONTINUOUS__DIRICHLET_HPP__
2 #define __STAN__PROB__DISTRIBUTIONS__MULTIVARIATE__CONTINUOUS__DIRICHLET_HPP__
39 template <
bool propto,
40 typename T_prob,
typename T_prior_sample_size,
42 typename boost::math::tools::promote_args<T_prob,T_prior_sample_size>::type
44 const Eigen::Matrix<T_prior_sample_size,Eigen::Dynamic,1>& alpha,
47 using boost::math::tools::promote_args;
48 typename promote_args<T_prob,T_prior_sample_size>::type lp(0.0);
53 for (
int k = 0; k < alpha.rows(); ++k)
57 for (
int k = 0; k < theta.rows(); ++k)
62 template <
bool propto,
63 typename T_prob,
typename T_prior_sample_size>
65 typename boost::math::tools::promote_args<T_prob,T_prior_sample_size>::type
67 const Eigen::Matrix<T_prior_sample_size,Eigen::Dynamic,1>& alpha) {
72 template <
typename T_prob,
typename T_prior_sample_size,
75 typename boost::math::tools::promote_args<T_prob,T_prior_sample_size>::type
77 const Eigen::Matrix<T_prior_sample_size,Eigen::Dynamic,1>& alpha,
79 return dirichlet_log<false>(theta,alpha,Policy());
82 template <
typename T_prob,
typename T_prior_sample_size>
84 typename boost::math::tools::promote_args<T_prob,T_prior_sample_size>::type
86 const Eigen::Matrix<T_prior_sample_size,Eigen::Dynamic,1>& alpha) {