Add script with correct theoretical covariance matrix calculation#23
Open
Bai-Chiang wants to merge 2 commits intosimonsobs:planckfrom
Open
Add script with correct theoretical covariance matrix calculation#23Bai-Chiang wants to merge 2 commits intosimonsobs:planckfrom
Bai-Chiang wants to merge 2 commits intosimonsobs:planckfrom
Conversation
damonge
reviewed
Jun 13, 2024
Collaborator
damonge
left a comment
There was a problem hiding this comment.
Thanks for this nice addition. I would like to keep this script simple-ish for quick tests, so would you mind creating a new script (call it generate_fiducal_spectra_xsplit.py or whatever you want) that includes these modifications?
If estimated power spectra is average over all cross spectra across all splits, the covariance matrix calculation in the simple script was not correct. Add a separate script with correct one. Also add a comment to old script to avoid confusion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If estimated power spectra is average over all cross spectra across all splits, the covariance matrix calculation was not correct.
Some math:
If the estimated power spectrum of frequency$f_i$ polarization $p_i$ cross frequency $f_j$ polarization $p_j$ is average over all cross spectra
Then the theoretical prediction of the covariance matrix is (ignoring$f_{sky}$ and binning factor)
where$(s_{\alpha},s_{\beta})$ are all cross splits of $\hat{C}_l^{s_{\alpha}f_ip_i \times s_{\beta}f_j p_j}$ , and $(s_{\mu},s_{\mu})$ are all cross splits of $\hat{C}_l^{s_{\mu}f_kp_k \times s_{\nu}f_l p_l}$
The point is that some of the terms$<\hat{C}_l^{s_{\alpha}f_i p_i \times s_{\mu}f_k p_k}>$ would have noise power, while others only have signal. The old calculation overestimated the covariance, the new one should decrease std in final result, which is what I found when testing with
mainbranch code.This commit simply loop over two summation$\sum_{(s_{\alpha}, s_{\beta})} \sum_{(s_{\mu}, s_{\nu})}$ and accumulate each term, since I find it's hard to calculate how many terms have (both or one or none) noise spectrum.