Skip to content

Commit

Permalink
Fix division to multiplication of precision diagonal in minnesota
Browse files Browse the repository at this point in the history
  • Loading branch information
ygeunkim committed Jan 16, 2025
1 parent 8140900 commit 6c14b9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inst/include/bvhardraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ inline void minnesota_lambda(double& lambda, double& shape, double& rate, Eigen:
boost::random::mt19937& rng) {
coef_prec.array() *= lambda;
// double gig_chi = (coef - coef_mean).squaredNorm();
double gig_chi = ((coef - coef_mean).array().square() / coef_prec.array()).sum();
double gig_chi = ((coef - coef_mean).array().square() * coef_prec.array()).sum();
lambda = sim_gig(1, shape - coef.size() / 2, 2 * rate, gig_chi, rng)[0];
cut_param(lambda);
coef_prec.array() /= lambda;
Expand Down

0 comments on commit 6c14b9f

Please sign in to comment.