UT-CHG / BET

Python package for data-consistent stochastic inverse and forward problems.
http://ut-chg.github.io/BET
Other
11 stars 21 forks source link

Comparing Measures #340

Closed mathematicalmichael closed 5 years ago

mathematicalmichael commented 5 years ago

This PR implements a new sub-module that allows for the comparison of probability measures defined on different sample sets.

A sample set object is used as a reference "mesh" for evaluating various measures of similarity (metrics, distances, KL, etc), and a query is performed against two other sample sets so that the densities are evaluated at the same values in space.

Methods exist for setting the two measures (denoted left and right for the two arguments into a metric/distance), evaluating the densities on the reference mesh (including the "expensive" step of building pointers with nearest-neighbor), and some commonly-used functions are implemented as string-arguments.

All sorts of care is taken for user-induced error, avoiding mistaken computations due to differing domains, changing probabilities by re-solving a problem, etc. Since everything is pass-by-reference, in theory a solution can be updated (either by changing the observed or changing how a predicted distribution is computed), and the distance would reflect the change accordingly once the probabilities are updated.

codecov[bot] commented 5 years ago

Codecov Report

Merging #340 into master will increase coverage by 1.94%. The diff coverage is 94.12%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #340      +/-   ##
=========================================
+ Coverage   77.46%   79.4%   +1.94%     
=========================================
  Files          22      23       +1     
  Lines        3953    4418     +465     
=========================================
+ Hits         3062    3508     +446     
- Misses        891     910      +19
Impacted Files Coverage Δ
bet/postProcess/__init__.py 100% <100%> (ø) :arrow_up:
bet/sample.py 80.58% <68.18%> (+0.39%) :arrow_up:
bet/postProcess/compareP.py 95.37% <95.37%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3e78e4a...8ec9820. Read the comment docs.

mathematicalmichael commented 5 years ago

@smattis all the documentation has been added, but please let me know if I need to elaborate on any of them.

Have to re-build documentation, but either way the gh-pages branch is behind, so... doesn't seem like a priority.

mathematicalmichael commented 5 years ago

@eecsu all checks pass