Skip to content

Bug in iNKA covariance#291

Merged
sachaguer merged 4 commits into
feature/sp_validation-extend-to-tomographyfrom
bug/inka_covariance
Jul 21, 2026
Merged

Bug in iNKA covariance#291
sachaguer merged 4 commits into
feature/sp_validation-extend-to-tomographyfrom
bug/inka_covariance

Conversation

@sachaguer

Copy link
Copy Markdown
Contributor

Related to Issue #290 , this PR fixes a bug in the iNKA covariance. The analytical based noise bias computation was missing a decoupling step leading to a misestimated noise bias and likely larger error bars. The updated functions is running for cross-validation with Gaussian simulations from #286 .

Ready to be merge as soon as the cross-validation is performed. In the meantime, design and runtime review is welcomed.

@sachaguer sachaguer self-assigned this Jul 20, 2026
@sachaguer sachaguer added the bug Something isn't working label Jul 20, 2026
@sachaguer sachaguer linked an issue Jul 20, 2026 that may be closed by this pull request
@sachaguer sachaguer linked an issue Jul 20, 2026 that may be closed by this pull request
@sachaguer
sachaguer changed the base branch from develop to feature/sp_validation-extend-to-tomography July 20, 2026 12:05
@sachaguer

Copy link
Copy Markdown
Contributor Author

@cailmdaley, following #286, this PR is ready for a review.

@cailmdaley

Copy link
Copy Markdown
Collaborator

The fix is correct. I traced the decoupling end to end. The coupled analytic noise from Nicola et al. is now decoupled with the correct workspace. Coupled and decoupled quantities are used consistently downstream. Cross-bins correctly get zero noise bias. Approve.

One request, on a pre-existing issue this fix now touches: the signal and noise grids are misaligned by one multipole. get_fiducial_cl builds the signal on arange(1, lmax+1), so index i holds C(ℓ=i+1). The NaMaster output is 0-indexed, so index i holds N(ℓ=i). The sum fiducial_cl + noise_bias_cl therefore adds N(ℓ) to C(ℓ+1). The effect is small while the noise is flat, but please unify the two grids on the NaMaster convention (arange(0, lmax), ℓ=0,1 zeroed) so the fix rests on aligned inputs.

— Claude on behalf of Cail

@sachaguer

Copy link
Copy Markdown
Contributor Author

The best I found to fix this is to add a zero monopole and drop the last value of the fiducial.
CAMB crashes when computing a theory at ell=0 so it seems to be the best solution to me. Happy to do something else if someone has a better idea.

@sachaguer
sachaguer merged commit f8d814c into feature/sp_validation-extend-to-tomography Jul 21, 2026
1 check passed
@sachaguer
sachaguer deleted the bug/inka_covariance branch July 21, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: iNKA analytic covariance does not input decoupled noise bias

2 participants