Comments (8)
Hi @YutoMinami
I'm slightly confused by the notation you're using. Let's see if this clarifies things:
Let's say you want to compute the covariance between power spectrum cl_A1A2 and power spectrum cl_B1B2. Say that power spectrum cl_A1A2 is the cross-correlation between two fields (fA1,fA2)
and cl_B1B2 is the cross-correlation between (fB1,fB2)
. Then, you should use:
wA=nmt.NmtWorkspace()
wA=nmt.compute_coupling_matrix(fA1,fA2,b)
wB=nmt.NmtWorkspace()
wB=nmt.compute_coupling_matrix(fB1,fB2,b)
cwAB=nmt.NmtCovarianceWorkspace()
cwAB.compute_coupling_coefficients(fA1,fA2,fB1,fB2)
covariance = nmt.covariance_gaussian_covariance(cwAB, spin_A1, spin_A2, spin_B1, spin_B2,
cl_A1B1, cl_A1B2, cl_A2B1, cl_A2B2, wA, wB)
Does this make sense?
from namaster.
Hi @damonge
With such expression, I'd like to compute the covariance between power spectrum cl_A1A2 cl_A1A2.
fA1_0, fA1_2 = nmt.NmtField(mask, [inmap1[0] ], nmt.nmtField(mask, inmap1[1:]) )
fA2_0, fA2_2 = nmt.NmtField(mask, [inmap2[0]], nmt.nmtField(mask, inmap2[1:]) )
wA=nmt.NmtWorkspace()
wA=nmt.compute_coupling_matrix(fA1_2,fA2_2,b)
cw = nmt.NmtCovarianceWorkspace()
#cw.compute_coupling_coefficients(fA1_0,fA2_0,fA1_0,fA2_0) # This results in wrong covariance
cw.compute_coupling_coefficients(fA1_0,fA1_0,fA1_0,fA1_0) # This works well
covariance = nmt.covariance_gaussian_covariance(cw, 2,2,2,2,
cl_A1_2A2_2, cl_A1_2A2_2, cl_A1_2A2_2, cl_A1_2A2_2, wA, wA)
from namaster.
Hmmmh, that's surprising.
The call to compute_coupling_coefficients
should only depend on the masks of the different fields being passed. Since all of your fields have the same mask, this is very strange. Am I interpreting this correctly?
Also, note that if you just want power spectra and covariances for two spin-2 fields, you don't really need to generate any spin-0 fields at all (e.g. you could just pass fA1_2
instead of fA1_0
to compute_coupling_coefficents
).
from namaster.
The call to
compute_coupling_coefficients
should only depend on the masks of the different fields being passed. Since all of your fields have the same mask, this is very strange. Am I interpreting this correctly?
Yes. I checked again whether the same mask is passed to the different field and it is. Therefore I wondered what coefficients are intended to be calculated in the function.
Also, note that if you just want power spectra and covariances for two spin-2 fields, you don't really need to generate any spin-0 fields at all (e.g. you could just pass
fA1_2
instead offA1_0
tocompute_coupling_coefficents
).
Thanks.
from namaster.
Hi @damonge
I'm sorry I checked and re-run my program and found there is an incorrect explanation.
Though I said only
#cw.compute_coupling_coefficients(fA1_0,fA2_0,fA1_0,fA2_0)
solved the problem,
actually I also changed from
wA=nmt.compute_coupling_matrix(fA1_2,fA2_2,b)
to wA=nmt.compute_coupling_matrix(fA1_2,fA1_2,b)
when I got correct covariance matrix.
This means even for the calculation of variance of cross correlation, the same field is needed as an input.
I reproduced the small variance problem as the following:
I created one CMB sky map with some beam smoothing and two different noise map.
From them I created two CMB sky maps with different noise map (fA_1 and fA_2).
Then I calculate pseudo cl from fA_1 and fA_2 and use them as an input to gaussian_covariance()
.
For the workspace wA=nmt.compute_coupling_matrix(fA1_2,fA2_2,b)
is used.
Then I compared the variance of 'EB' from NaMaster and sample variance.
It shows that in low ell where CMB is dominant and CMB is auto correlated, NaMaster variance agrees to sample variance and in high ell where noise is dominant and noise is cross correlated, NaMaster variance becomes too small compared to sample variance as if there is no noise.
So, my question should be "How can I calculate correct variance from different realization?"
from namaster.
Hi @YutoMinami
I'm very sorry it's taken me so long to respond. The covariance for the EB power spectrum is very inaccurate in the approximation used by namaster (we show this here: https://arxiv.org/abs/1906.11765), so I'm not completely surprised that this doesn't work well. I this case I think the best way forward is actually using simulations.
I'm still suprised that the resulting covariance depends on the fields you pass to compute_coupling_coefficients
if all of them have the same mask... Is that still the case?
from namaster.
I'll close this for now, but feel free to reopen
from namaster.
Hi @damonge
As I explained in
#61 (comment) ,
I changed both compute_coupling_matrix
and compute_coupling_coefficients
.
Therefore, I think compute_coupling_coefficients
itself doesn't make change.
Thank you.
from namaster.
Related Issues (20)
- Large array size with synfast_flat HOT 2
- nan's with map read from fits file HOT 2
- random seed in synfast_flat
- I am not seeing a real improvement in performance, but it might be my own compiler being a bit outdated. Still worth merging, since libsharp2 is the one being maintained, but will open an issue to investigate further.
- configure fails to find cfitsio HOT 7
- Missing version number in pymaster
- Help installing NaMaster on M2 macOS HOT 17
- cannot find _nmtbin module HOT 4
- Error when setting lmax < 3 * nside - 1 in compute_full_master HOT 2
- Missing different lmax for mask and coupling coefficients for covariances HOT 1
- f_ell does not seem to do anything in NmtBin HOT 1
- Conda installation fails if conda installs gsl=2.7.1 instead of gsl=2.7
- Inconsistency in results between MacOS and Ubuntu HOT 13
- Make exception message more informative
- Weird power in compute_coupled_cell HOT 3
- pymaster installation problem HOT 3
- Pseudo-cl's in the covariance computation - pixel window function HOT 3
- Floating point errors with full sky CAR pixellization HOT 1
- NaMaster installation CFITSIO issue
- Apodisation window functions HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from namaster.