bangerth / SampleFlow

SampleFlow -- a library for composing complex statistical sampling algorithms
GNU Lesser General Public License v2.1
4 stars 5 forks source link

Accept -max over -infinity #182

Open bangerth opened 2 years ago

bangerth commented 2 years ago

-max() might be zero probability, but it's still better than -infinity(). Accept samples if that happens. See

          const bool trial_sample_has_zero_probability
            = ((trial_log_likelihood == -std::numeric_limits<double>::max())
               ||
               (trial_log_likelihood == -std::numeric_limits<double>::infinity()));
          const bool current_sample_has_zero_probability
            = ((current_log_likelihood == -std::numeric_limits<double>::max())
               ||
               (current_log_likelihood == -std::numeric_limits<double>::infinity()));

          bool repeated_sample;
          if (!(trial_sample_has_zero_probability && !current_sample_has_zero_probability)

@dklong-csu -- FYI

bangerth commented 2 years ago

Also correspondingly update the documentation. This has to happen in all of the sampling algorithms we have.