Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computation of PDF integral #643

Closed
m-aguena opened this issue Sep 24, 2024 · 0 comments · Fixed by #644
Closed

Computation of PDF integral #643

m-aguena opened this issue Sep 24, 2024 · 0 comments · Fixed by #644

Comments

@m-aguena
Copy link
Collaborator

In the current computation of the weights for pdfs with shared bins:

        mask = (pzbins >= zmin) * (pzbins <= zmax)
        z_grid = pzbins[mask]
        pz_matrix = np.array(pzpdf)[:, mask]
        kernel_matrix = kernel(z_grid)

    return simpson(pz_matrix * kernel_matrix, x=z_grid, axis=1)

the precision is limited to the pdf bin sizes (pzbins). This can have a significant impact on the integral. For instance:

image

and dz=0.05 is similar to what we might get from the PZ WG. So I propose to interpolate the pdf in finer bins before integration

@m-aguena m-aguena linked a pull request Sep 26, 2024 that will close this issue
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 a pull request may close this issue.

1 participant