rmjarvis / TreeCorr

Code for efficiently computing 2-point and 3-point correlation functions. For documentation, go to
http://rmjarvis.github.io/TreeCorr/
Other
97 stars 37 forks source link

Access correlation function for jackknife #132

Closed Uendert closed 2 years ago

Uendert commented 2 years ago

Hello Jarvis,

Is there a simple way to access the correlation function that would have been measured if one patch at a time is excluded from the sample, as is done internally for the jackknife? In other words, I'd like to have access to the sample of \xi_i computed when excluding one patch at a time. Maybe this can be an attribute similar to the covariance matrix.

Thanks for your time, Uendert

rmjarvis commented 2 years ago

They aren't available via the public API, but the top-level code for computing the jackknife covariance is pretty short, so you could pull it out and run it separately, stopping after making the design matrix: https://github.com/rmjarvis/TreeCorr/blob/releases/4.2/treecorr/binnedcorr2.py#L1315

The rows of the v matrix are what you are asking about.

rmjarvis commented 2 years ago

Hi Uendert, I finally got around to implementing this. Now there are functions corr.build_cov_design_matrix and treecorr.build_multi_cov_design_matrix (corresponding to corr.estimate_cov and treecorr.estimate_multi_cov respectively).

If you'd like to take a look, the PR is #146. Let me know if this doesn't seem to have what you need. It's slated to be released with the next minor version, 4.3.