Skip to content

Commit

Permalink
Cheers Clarence for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KSkwarczynski authored Dec 2, 2024
1 parent 91028f0 commit 01451f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mcmc/SampleSummary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,6 @@ void SampleSummary::StudyInformationCriterion(M3::kInfCrit Criterion) {
// ****************
MACH3LOG_INFO("******************************");
switch(Criterion) {
// TSpline3 (third order spline in ROOT)
case M3::kInfCrit::kBIC:
// Study Bayesian Information Criterion
StudyBIC();
Expand Down Expand Up @@ -2584,15 +2583,15 @@ void SampleSummary::StudyWAIC() {
sum_exp_llh /= nThrows;
sum_exp_llh = std::log(sum_exp_llh);

// Log pointwise predictive density based on Eq. 4
// Log pointwise predictive density based on Eq. 4 in Gelman2014
lppd += sum_exp_llh;

// Compute the effective number of parameters for WAIC
p_WAIC += mean_llh_squared - (mean_llh * mean_llh);
}
}

// Compute WAIC, see Eq. 13
// Compute WAIC, see Eq. 13 in Gelman2014
double WAIC = -2 * (lppd - p_WAIC);
MACH3LOG_INFO("Effective number of parameters following WAIC formalism is equal to: {:.2f}", p_WAIC);
MACH3LOG_INFO("WAIC = {:.2f}", WAIC);
Expand Down

0 comments on commit 01451f0

Please sign in to comment.