dfm / dfm/corner.py

Smoothing of correlated variables

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
576
Forks
234
PR merge metrics
No merged PRs in 30d

Description

The smoothing implemented in corner.py does not handle strongly correlated variables very well.

The smoothing for 2D histograms is done with the scipy gaussian_filter function, which is isotropic. If your variables are highly correlated this is pretty distorting, since it smooths points in the wrong directions. See the Delta-M versus h subplot in the attached image, where the contour is enlarged a lot in one direction.

The easiest way to solve this in general is to either supply a covariance matrix to use an elliptical smoothing kernel, or transform to variables with unit covariance before smoothing. Neither of those is a simple change here, unfortunately.

corner

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading corner.py and locating the 2D histogram smoothing path that calls scipy's gaussian_filter. Compare the current isotropic behavior with the correlated Delta-M versus h example, then determine whether covariance-based smoothing or a unit-covariance transformation fits the design. Done means strongly correlated variables no longer produce contours enlarged in the wrong direction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.