Skip to content

Commit

Permalink
Correct units for "uniform-like proposal" warn
Browse files Browse the repository at this point in the history
Address libqueso#658 by using sqrt(Covariance(i,i)) to compare
standard deviation to to domain bounds.
  • Loading branch information
briadam committed Feb 23, 2018
1 parent 469911a commit f2f81dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/stats/src/TransformedScaledCovMatrixTKGroup.C
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,16 @@ TransformedScaledCovMatrixTKGroup<V, M>::transformCovMatrixToGaussianSpace(
double max_val = max_domain_bounds[i];

if (queso_isfinite(min_val) && queso_isfinite(max_val)) {
if (covMatrix(i, i) >= max_val - min_val) {
if (std::sqrt(covMatrix(i, i)) >= max_val - min_val) {
// User is trying to specify a uniform proposal distribution, which
// is unsupported. Throw an error for now.
std::cerr << "Proposal variance element "
<< i
<< " is "
<< covMatrix(i, i)
<< " but domain is of size "
<< " (standard deviation is "
<< std::sqrt(covMatrix(i, i))
<< ") but domain is of size "
<< max_val - min_val
<< std::endl;
std::cerr << "QUESO does not support uniform-like proposal "
Expand Down

0 comments on commit f2f81dc

Please sign in to comment.