Skip to content

Add noise_cover for biwhitening noisy data - #107

Merged
timholy merged 2 commits into
mainfrom
teh/noise-cover
Oct 28, 2026
Merged

timholy merged 2 commits into
mainfrom
teh/noise-cover

Conversation

@timholy

@timholy timholy commented Oct 28, 2026

Copy link
Copy Markdown
Member

noise_cover(V; shrink=0) returns scales a and b such that the data divided by a*b' has noise of unit average variance in every row and column, given a matrix V of noise-variance estimates. For Poisson counts, V = Y gives the biwhitening of Landa, Zhang, and Kluger (2022). The targets count the zero entries of V; zero rows and columns receive zero scale.

With shrink = 0, a max-flow test on the zero pattern of V certifies before solving that the scaling exists, and a SolverFailure names the rows or entries that prevent it. shrink = δ > 0 instead scales (V + δ*r*c'/s) / (1 + δ), which has the same total as V and always admits a scaling; the rank-one term is never formed as a dense matrix.

The products are computed by the PowerMean solver, which now accepts optional per-group targets and, for p = 1, an additive rank-one term. Without them, soft_cover and soft_symcover are unchanged. A new guide page describes how to build V for counts, camera data, and differences such as ΔF, and how to use the normalized matrix.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com

`noise_cover(V; shrink=0)` returns scales `a` and `b` such that the data
divided by `a*b'` has noise of unit average variance in every row and
column, given a matrix `V` of noise-variance estimates. For Poisson
counts, `V = Y` gives the biwhitening of Landa, Zhang, and Kluger (2022).
The targets count the zero entries of `V`; zero rows and columns receive
zero scale.

With `shrink = 0`, a max-flow test on the zero pattern of `V` certifies
before solving that the scaling exists, and a `SolverFailure` names the
rows or entries that prevent it. `shrink = δ > 0` instead scales
`(V + δ*r*c'/s) / (1 + δ)`, which has the same total as `V` and always
admits a scaling; the rank-one term is never formed as a dense matrix.

The products are computed by the `PowerMean` solver, which now accepts
optional per-group targets and, for p = 1, an additive rank-one term.
Without them, `soft_cover` and `soft_symcover` are unchanged. A new guide
page describes how to build `V` for counts, camera data, and
differences such as ΔF, and how to use the normalized matrix.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.82353% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.33%. Comparing base (dcaf2eb) to head (ca39345).

Files with missing lines Patch % Lines
src/powermean_newton.jl 95.65% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
+ Coverage   98.31%   98.33%   +0.02%     
==========================================
  Files          25       26       +1     
  Lines        7824     8222     +398     
==========================================
+ Hits         7692     8085     +393     
- Misses        132      137       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

A comment between a docstring and the definition it documents
separates the two, so `noise_cover` had no documentation and the
docs build could not resolve references to it.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@timholy
timholy merged commit 0b8d00b into main Oct 28, 2026
7 checks passed
@timholy
timholy deleted the teh/noise-cover branch October 28, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant