autoppl
v0.8
A C++ template library for probabilistic programming
|
Go to the documentation of this file.
2 #include <fastad_bits/reverse/stat/wishart.hpp>
8 #define PPL_WISHART_PARAM_SHAPE \
9 "Wishart distribution scale matrix must have shape mat or selfadjmat " \
10 "and n must be a scalar. "
33 static_assert(util::is_var_expr_v<v_t>);
34 static_assert(util::is_var_expr_v<n_t>);
35 static_assert(util::is_mat_v<v_t> &&
60 template <
class XType>
63 static_assert(util::is_dist_assignable_v<XType>);
64 static_assert(util::is_mat_v<XType>,
72 const PtrPackType& pack)
const
74 static_assert(util::is_dist_assignable_v<XType>);
75 static_assert(util::is_mat_v<XType>,
77 return ad::wishart_adj_log_pdf(x.ad(pack),
82 template <
class PtrPackType>
83 void bind(
const PtrPackType& pack)
85 static_cast<void>(pack);
86 if constexpr (v_t::has_param) {
89 if constexpr (n_t::has_param) {
100 template <
class XType,
class GenType>
101 bool prune(XType&, GenType&)
const {
return false; }
116 template <
class VType,
class NType
117 ,
class = std::enable_if_t<
118 util::is_valid_dist_param_v<VType> &&
119 util::is_valid_dist_param_v<NType>
121 inline constexpr
auto wishart(
const VType& v_expr,
127 v_t wrap_v_expr = v_expr;
128 n_t wrap_n_expr = n_expr;
135 #undef PPL_WISHART_PARAM_SHAPE
Wishart(const v_t &v, const n_t &n)
Definition: wishart.hpp:46
void activate_refcnt() const
Definition: wishart.hpp:94
Definition: dist_expr_traits.hpp:24
void bind(const PtrPackType &pack)
Definition: wishart.hpp:83
bool prune(XType &, GenType &) const
Definition: wishart.hpp:101
#define PPL_WISHART_PARAM_SHAPE
Definition: wishart.hpp:8
constexpr auto wishart(const VType &v_expr, const NType &n_expr)
Definition: wishart.hpp:121
dist_value_t log_pdf(const XType &x) const
Definition: wishart.hpp:61
dist_value_t wishart_log_pdf(const Eigen::MatrixBase< XType > &x, const Eigen::MatrixBase< VType > &v, const NType &n)
Definition: density.hpp:608
util::dist_value_t dist_value_t
Definition: dist_expr_traits.hpp:26
double cont_param_t
Definition: dist_expr_traits.hpp:14
Definition: wishart.hpp:28
Definition: bounded.hpp:11
typename details::convert_to_param< T >::type convert_to_param_t
Definition: traits.hpp:148
auto ad_log_pdf(const XType &x, const PtrPackType &pack) const
Definition: wishart.hpp:71
util::dist_value_t dist_value_t
Definition: dist_expr_traits.hpp:26
#define PPL_DIST_SHAPE_MISMATCH
Definition: dist_utils.hpp:2
util::cont_param_t value_t
Definition: wishart.hpp:42