Skip to content

Display $chi^2$ for shown bins in two-dimensional plots - #503

Merged
markrosslonergan merged 3 commits into
markrosslonergan:project-SBN-devfrom
epelaaez:2d-chi2-display
Aug 11, 2026
Merged

Display $chi^2$ for shown bins in two-dimensional plots#503
markrosslonergan merged 3 commits into
markrosslonergan:project-SBN-devfrom
epelaaez:2d-chi2-display

Conversation

@epelaaez

@epelaaez epelaaez commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

This PR addresses #481 by making it so each slice and projection in a set of two-dimensional plots shows the $\chi^2/\text{nbins}$ only for the displayed bins rather than for the whole fit. It also adds the full $\chi^2$ to the two-dimensional heat maps.

For each 2D slice or projection, a matrix $P$ maps the original flattened bins onto the bins displayed on that page as $s' = Ps$, where $s$ contains the original bins and $s'$ the ones displayed. Each row of $P$ is one displayed bin. It selects or sums over bins from $s$ to construct $s'$.

For PROchi and PROCNP, the residual and covariance are projected like $\delta' = P\delta, M' = PMP^T$ and $\chi^2 = \delta'^T(M')^{-1}\delta'$. For the Poisson metric, the prediction and data are projected first as $\mu' = P\mu, n' = Pn$, and the Poisson statistic is evaluated using the projected counts.

A few examples:

Screenshot 2026-08-08 at 2 24 43 p m Screenshot 2026-08-08 at 2 25 06 p m Screenshot 2026-08-08 at 2 25 23 p m

@markrosslonergan
markrosslonergan merged commit ecd06eb into markrosslonergan:project-SBN-dev Aug 11, 2026
1 check passed
@epelaaez
epelaaez deleted the 2d-chi2-display branch August 11, 2026 15:52
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.

2 participants