Skip to content

Commit

Permalink
Old code commented
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoGiane committed Mar 22, 2024
1 parent dc9ccee commit 57e0d0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/hierarchies/likelihoods/beta_likelihood.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ double BetaLikelihood::compute_lpdf(const Eigen::RowVectorXd &datum) const {
return stan::math::beta_lpdf(datum(0), state.shape, state.rate);
}

Eigen::VectorXd BetaLikelihood::sample() const {
Eigen::VectorXd out(1);
auto &rng = bayesmix::Rng::Instance().get();
out(0) = stan::math::beta_rng(state.shape, state.rate, rng);
out = out.cwiseMin(1.0 - 1e-8).cwiseMax(1e-8);
return out;
}
// Eigen::VectorXd BetaLikelihood::sample() const {
// Eigen::VectorXd out(1);
// auto &rng = bayesmix::Rng::Instance().get();
// out(0) = stan::math::beta_rng(state.shape, state.rate, rng);
// out = out.cwiseMin(1.0 - 1e-8).cwiseMax(1e-8);
// return out;
// }

void BetaLikelihood::update_sum_stats(const Eigen::RowVectorXd &datum,
bool add) {
Expand Down
2 changes: 1 addition & 1 deletion src/hierarchies/likelihoods/beta_likelihood.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BetaLikelihood
bool is_dependent() const override { return false; };
void clear_summary_statistics() override;

Eigen::VectorXd sample() const override;
// Eigen::VectorXd sample() const override;

template <typename T>
T cluster_lpdf_from_unconstrained(
Expand Down

0 comments on commit 57e0d0d

Please sign in to comment.