Difference between revisions of "PureB by Messenger Method"

From CMB-S4 wiki
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''Michael Ray, 2019-09-xx''
+
''Michael Ray, Colin Bischoff, 2019-09-16''
 
----
 
----
  
Dr. Bischoff and myself have been working on a new approach to a pure-B estimator for CMB polarization data. The method was originally proposed in 2012 (Elsner & Wandelt 2012) and has been dubbed the "messenger method" approach to weiner filtering. To make a pure-B weiner filter, we represent the noise covariance matrix as the noise covariance plus the E component of the signal covariance (Bunn & Wandelt 2017), so that the filter treats any E modes as noise. This means the weiner filter equation becomes:
+
This posting describes an alternate pure-B estimator applied to the 95 GHz DC 04.00 maps with ''A<sub>L</sub>''=1. It uses the "messenger method" ([https://ui.adsabs.harvard.edu/abs/2013A%26A...549A.111E/abstract Elsner & Wandelt 2012]) to Wiener filter the maps. We treat the E-mode part of the signal covariance as if it was noise covariance ([https://ui.adsabs.harvard.edu/abs/2017PhRvD..96d3523B/abstract Bunn & Wandelt 2017]), so filter equation becomes:
  
***Fix equation below***
+
    map<sub>wf</sub> = (S<sub>B</sub>/(S<sub>B</sub>+S<sub>E</sub>+N)) * map,
<data_wf = S_b/(S_b+S_e+N)*data>
+
  
The difficulty in weiner filtering for CMB analysis lies in the fact that we can only easily write down S in the sphereical harmonic basis, and N in the pixel basis. In fact, S is diagonal in spherical harmonic space, and N is diagonal in pixel space. Because of this, we must use a work around in order to weiner filter maps. The general approach of the messenger method is to introduce a new field, t, which is called the "messenger field". This field has covariance T, which is proportional to the identity matrix and represents the homogeneous portion of the noise covariance. Being proportional to the identity matrix, T can be written diagonally in any basis we choose (Elsner and Wandelt 2012).
+
where <tt>S<sub>E,B</sub></tt> are the E-mode and B-mode parts of the signal covariance.
  
Since we have multiple matrices that can only be written in one basis, this suggests some sort of iterative algorithm to solve for a weiner filtered map where we use the messenger field t and its covariance matrix to mediate between pixel and sphereical harmonic space. Elsner and Wandelt lay out this procedure in their paper and they come up with two equations to be solved iteratively for a weiner filtered map. In their equations, there is a lambda parameter which is a scale factor used to artificially increase the covariance T. This is useful in speeding up convergence of the algorithm. At the end of the algorithm, lambda must be reduced to 1 in order to solve for the true weiner filtered map.
+
For these simulations with unfiltered skies, the signal covariance is diagonal in the spherical harmonic basis. We treat the noise covariance as diagonal in the pixel basis (not strictly true because of the white + 1/&#x2113; noise spectrum in the data challenge maps). The messenger method iteratively solves fo the Wiener-filtered map by introducing a messenger field, <tt>t</tt>, with covariance matrix, <tt>T</tt>, that is proportional to the identity matrix, so it can be written easily in any basis. For each step of the algorithm, we transform back and forth between pixel space and spherical harmonic space, with the messenger field carrying information between the two bases.
  
In our implementation, lambda begins at a value of 1300, then on the second iteration it is decreased to 100, and from then on out, lambda -> lambda*eta on each iteration, where eta = 0.825. When lambda reaches 1, our algorithm iterates another 5 times. We have experimented fairly extensively with other cooling schedules for lambda and found that our method gives the best convergence in the least amount of time. We are able to filter a single set of Q and U maps in 34 minutes on a single processor. Shown below is an example of a filtered and unfiltered map for visualization of what our algorithm is doing. The input maps below came from CMBS4 combined simulations at 95 GHz using experiment configuration 04.00. So far, the only maps we have done any work with are at 95 GHz and in this experiment configuration. The algorithm is set up to work with any set of Q and U maps, however, and thus can easily be used at any frequency with any experimental configuration.
+
As a first demonstration, we applied this technique to the 95 GHz DC 04.00 maps (Gaussian foregrounds, circular 3% fsky mask). The signal covariance matrices (in spherical harmonic space) are set to lensed-LCDM EE and BB spectra (purely diagonal), multiplied by ''B<sub>&#x2113;</sub><sup>2</sup>'' and zeroed for &#x2113; &lt; 30 (this last choice appears to have consequences for the bandpower window functions). We did not include any foreground contribution to the signal covariance. The noise covariance is diagonal in pixel space, with values equal to 0.01 &mu;K<sup>2</sup> times the inverse of the mask (checked against a set of noise maps). For unobserved pixels, the noise covariance is set to a very large but finite value.
  
 +
The messenger method includes parameter, &lambda;, which scales the covariance of the messenger field. Convergence proceeds more quickly for large values of &lambda;, but the final solution is obtained for &lambda; = 1. This means that we want to implement a "cooling schedule" for efficient filtering. In our implementation, &lambda; starts at a value of 1300, is decreased to 100 on the second iteration, and then is reduced by factor &eta; = 0.825 on each subsequent iteration. When &lambda; reaches 1, we iterate an additional 5 times. We have experimented fairly extensively with other cooling schedules and found that this method gives good convergence in a reasonable amount of time. (We are able to filter a single set of Q and U maps in 34 minutes on a single processor.)
  
***Put in images of input and output Q maps.***
+
Figures 1 and 2 show a map before and after filtering. The input maps is dominated by LCDM E modes. The output map contains B modes from foregrounds and lensing. The output map color scale has been zoomed in so that we can see that the pure-B filtering operation has extended the map into the unobserved region.
  
 +
{|
 +
|[[File:Q input map.png|frame|Figure 1: Input Q signal plus noise map. This is zoomed in on the unmasked region of the map.]]
 +
|[[File:Q output map.png|frame|Figure 2: Output Q signal plus noise map. This has been filtered through our pure B estimator. This map is also zoomed in on the unmasked region although the algorithm extends the map into the unmasked region.]]
 +
|}
  
The algorithm takes in a set of two maps, corresponding to a Q and U measurement, and outputs a B only weiner filtered set of Q and U maps. One can visually see that although the input map has a defined edge, the algorithm extends the output map into the unobserved region. This is because the code is coming up with a full sky weiner filtered map and thus any power detected at low ell will result in map fluctuations at large angular scales. It is also visually apparent that the input Q map contains mostly E modes (fluctuations that appear straight up and down or straight across), while the output Q map looks like it's all B modes (diagonal fluctuations). This is exactly what we would hope to see from a pure-B estimator. Note that there is a scale difference between the two plots. This is because the input map contains E signal, so the Q map will have a larger amplitude in each pixel for the input map than the output map which contains only B modes.
+
After applying the filter, we calculate the BB spectrum with anafast and bin with &Delta;&#x2113;=35, to match the pure-S2hat analysis. Noise bias is measured from 100 noise-only simulations. Bandpower window functions (Figures 4 and 5) and suppression factors are calculated by running &#x2113;-by-&#x2113; simulations (but only 6 realizations per &#x2113; value so far). Figure 3 shows noise-debiased and suppression-factor-corrected power spectra for 100 LCDM+foregrounds+noise simulations. The expectation value line is calculated by applying the bandpower window functions to a LCDM+foregrounds model that matches the sims.  
  
There is still some noise bias in the output map, however we can remove that through using monte carlo methods. There is also a suppression factor involved in the output data which is the reason for the scale difference in plots. This factor is corrected for through the use of band power window functions. Both the noise debiasing and suppression factor correction are made at the power spectrum level only. We are not capable of applying noise and suppression factor corrections to maps.
+
There is some noticeable bias in the last bin especially. Something is clearly off with the calculations for this bin (see bandpower window functions) and needs to be investigated.
  
Shown below is a plot of 100 spectra which are cleaned signal plus noise maps at 95 GHz taken from the 04.00 CMBS4 experiment configuration. The bins used in this analysis began at ell of 20, and went up through ell of 370 with a bin size of 35. So, bin number zero is ell of 20 - 55. Bin 9 (last bin) is ell of 335 - 370. Also included is the mean of these 100 spectra and the expectation value which was calculated using band power window functions and theory BB spectra.
+
[[File:Filtered specs mean vs expectation.png|frame|Figure 3: Band powers of 100 filtered signal plus noise simulations. These were filtered using the messenger method estimator. Also shown is the mean and the expectation value calculated using band power window functions and BB theory spectra.|center]]
  
 +
Figures 4 and 5 show bandpower window functions for input B modes >> output BB (left) and input E modes >> output BB (right). These were calculated by running just six simulations for each &#x2113; value, and could be made less noisy with additional computation. The purity of the estimator can be seen by comparing the absolute level of the two sets of functions; the first ell bin responds has response to B modes that is ~1000x greater than the response to E modes. Our initial reaction was that this is not an extremely impressive level of purity (though it is better than simply masking and running anafast). However, keep in mind that we are using a Wiener filter that knows about the noise level, so it might choose to keep modes that are slightly ambiguous if they result in a net decrease in bandpower variance.
  
***Put in plots of filtered signal plus noise band powers***
+
The input B >> output BB window functions show a prominent bump for &#x21113; < 30. This is probably due to the choice we made to zero the E and B signal covariance matrices in that range (which does match the sim construction). Our naive expectation based on the Wiener filter equation was that the filter would kill that &#x2113; range because it contains no signal, but clearly this is not happening. We plan to investigate this by calculating window functions without zeroing that part of the covariance matrix.
  
 +
The 10th &#x2113; bin shows odd behavior, with no upper end cutoff and very different normalization from other bins. This might just be a bug in the binning code. That bin also showed the largest bias in Figure 3, which might be related.
  
As one can see, the expectation value for our estimator runs directly through the middle of our simulations and is very close to our mean. It is worth noting that there is definitely something out of the ordinary happening in our last bin. In this bin, we routinely get results that do not agree with the rest of the data. Because of this, we generally ignore results from the last bin given that we are not too worried with what is happening at that ell range anyway. Shown below are plots of BB to BB and EE to BB band power window functions for both the messenger method estimator and the S2hat estimator. Band power window functions for the messenger estimator were calculated with an input signal C_ell = 1 on the sky. This means that the actual input power for deriving band power window functions is 1 * B_ell squared, where B_ell squared contains the effect of the beam. We also ran 6 simulations at each ell with this input power and then took the mean of the output across these six simulations to get the final band power window functions. Summing the window functions across ell values gives us the total suppression factor.
+
{|
 +
|[[File:Messenger bb2bb bpwf.png|frame|Figure 4: BB to BB band power window functions using messenger method pure-B estimator.]]
 +
|[[File:Messenger ee2bb bpwf.png|frame|Figure 5: EE to BB band power window functions using messenger method pure-B estimator.]]
 +
|}
  
 +
Figure 6 shows the variance calculated from BB bandpowers of the first 100 signal + noise maps by pure-S2hat and by this estimator. The Wiener filter / messenger method estimator produces lower variance for all bins (but the last bin shouldn't be trusted, for reasons discussed above). We believe that at least part of this improvement is because the Wiener filter considers both signal and noise variance, so it could decide to keep more modes for a signal-dominated case. There results are from sims with ''A<sub>L</sub>'' = 1, which is a pretty large B-mode signal when compared to the CMB-S4 forecasted 95 GHz noise. We expect that the improvement would be much smaller for maps that have been delensed.
  
***Put in plots of s2hat and messenger band power window functions***
+
[[File:Variance comparison.png|frame|Figure 6: Comparison of messenger method and S2hat estimator when it comes to the variance in each bin.|center]]
  
 
+
There are several steps that are still needed before this estimator can be used as part of a full Data Challenge analysis:
Again, it is visually apparent that there is something odd going on in the last bin for the messenger method estimator.
+
* Look into the effect of zeroing signal covariance for &#x2113; < 30. Is this responsible for the low-&#x2113; feature in the bandpower window functions?
 
+
* Figure out what is going on with the 10th &#x2113; bin.
Below are plots the variance in each bin across the 100 realizations which were filtered. The exact same simulations were used as input to the two methods compared (signal plus noise simulations at 95 GHz using the 04.00 experiment configuration).
+
* Incorporate this filter into a pipeline infrastructure that can run on all maps, take cross-spectra, calculate TT, EE, TE, EB, TB, etc.
 
+
 
+
[[File:Variance Comparison.png|frame|Figure 1: Marginalized likelihood on r for four experiment configurations|center]]
+
 
+
As shown above, the messenger method beats the S2hat estimator in terms of variance per bin. We believe the main reason for this is that the S2hat estimator uses a simple weighting of 1/N to filter the maps. Since the signal plus noise simulations have a sizeable amount of BB lensing signal contained within them, the fact that we are doing a weiner filter (and thus taking into account the signal covariance) means that we would expect to get a large improvement over an estimator which only knows about noise covariance. For delensed simulations, we would expect to see less of an improvement from the messenger method over the S2hat filtering.
+

Latest revision as of 09:13, 16 September 2019

Michael Ray, Colin Bischoff, 2019-09-16


This posting describes an alternate pure-B estimator applied to the 95 GHz DC 04.00 maps with AL=1. It uses the "messenger method" (Elsner & Wandelt 2012) to Wiener filter the maps. We treat the E-mode part of the signal covariance as if it was noise covariance (Bunn & Wandelt 2017), so filter equation becomes:

    mapwf = (SB/(SB+SE+N)) * map,

where SE,B are the E-mode and B-mode parts of the signal covariance.

For these simulations with unfiltered skies, the signal covariance is diagonal in the spherical harmonic basis. We treat the noise covariance as diagonal in the pixel basis (not strictly true because of the white + 1/ℓ noise spectrum in the data challenge maps). The messenger method iteratively solves fo the Wiener-filtered map by introducing a messenger field, t, with covariance matrix, T, that is proportional to the identity matrix, so it can be written easily in any basis. For each step of the algorithm, we transform back and forth between pixel space and spherical harmonic space, with the messenger field carrying information between the two bases.

As a first demonstration, we applied this technique to the 95 GHz DC 04.00 maps (Gaussian foregrounds, circular 3% fsky mask). The signal covariance matrices (in spherical harmonic space) are set to lensed-LCDM EE and BB spectra (purely diagonal), multiplied by B2 and zeroed for ℓ < 30 (this last choice appears to have consequences for the bandpower window functions). We did not include any foreground contribution to the signal covariance. The noise covariance is diagonal in pixel space, with values equal to 0.01 μK2 times the inverse of the mask (checked against a set of noise maps). For unobserved pixels, the noise covariance is set to a very large but finite value.

The messenger method includes parameter, λ, which scales the covariance of the messenger field. Convergence proceeds more quickly for large values of λ, but the final solution is obtained for λ = 1. This means that we want to implement a "cooling schedule" for efficient filtering. In our implementation, λ starts at a value of 1300, is decreased to 100 on the second iteration, and then is reduced by factor η = 0.825 on each subsequent iteration. When λ reaches 1, we iterate an additional 5 times. We have experimented fairly extensively with other cooling schedules and found that this method gives good convergence in a reasonable amount of time. (We are able to filter a single set of Q and U maps in 34 minutes on a single processor.)

Figures 1 and 2 show a map before and after filtering. The input maps is dominated by LCDM E modes. The output map contains B modes from foregrounds and lensing. The output map color scale has been zoomed in so that we can see that the pure-B filtering operation has extended the map into the unobserved region.

Figure 1: Input Q signal plus noise map. This is zoomed in on the unmasked region of the map.
Figure 2: Output Q signal plus noise map. This has been filtered through our pure B estimator. This map is also zoomed in on the unmasked region although the algorithm extends the map into the unmasked region.

After applying the filter, we calculate the BB spectrum with anafast and bin with Δℓ=35, to match the pure-S2hat analysis. Noise bias is measured from 100 noise-only simulations. Bandpower window functions (Figures 4 and 5) and suppression factors are calculated by running ℓ-by-ℓ simulations (but only 6 realizations per ℓ value so far). Figure 3 shows noise-debiased and suppression-factor-corrected power spectra for 100 LCDM+foregrounds+noise simulations. The expectation value line is calculated by applying the bandpower window functions to a LCDM+foregrounds model that matches the sims.

There is some noticeable bias in the last bin especially. Something is clearly off with the calculations for this bin (see bandpower window functions) and needs to be investigated.

Figure 3: Band powers of 100 filtered signal plus noise simulations. These were filtered using the messenger method estimator. Also shown is the mean and the expectation value calculated using band power window functions and BB theory spectra.

Figures 4 and 5 show bandpower window functions for input B modes >> output BB (left) and input E modes >> output BB (right). These were calculated by running just six simulations for each ℓ value, and could be made less noisy with additional computation. The purity of the estimator can be seen by comparing the absolute level of the two sets of functions; the first ell bin responds has response to B modes that is ~1000x greater than the response to E modes. Our initial reaction was that this is not an extremely impressive level of purity (though it is better than simply masking and running anafast). However, keep in mind that we are using a Wiener filter that knows about the noise level, so it might choose to keep modes that are slightly ambiguous if they result in a net decrease in bandpower variance.

The input B >> output BB window functions show a prominent bump for 𡄓 < 30. This is probably due to the choice we made to zero the E and B signal covariance matrices in that range (which does match the sim construction). Our naive expectation based on the Wiener filter equation was that the filter would kill that ℓ range because it contains no signal, but clearly this is not happening. We plan to investigate this by calculating window functions without zeroing that part of the covariance matrix.

The 10th ℓ bin shows odd behavior, with no upper end cutoff and very different normalization from other bins. This might just be a bug in the binning code. That bin also showed the largest bias in Figure 3, which might be related.

Figure 4: BB to BB band power window functions using messenger method pure-B estimator.
Figure 5: EE to BB band power window functions using messenger method pure-B estimator.

Figure 6 shows the variance calculated from BB bandpowers of the first 100 signal + noise maps by pure-S2hat and by this estimator. The Wiener filter / messenger method estimator produces lower variance for all bins (but the last bin shouldn't be trusted, for reasons discussed above). We believe that at least part of this improvement is because the Wiener filter considers both signal and noise variance, so it could decide to keep more modes for a signal-dominated case. There results are from sims with AL = 1, which is a pretty large B-mode signal when compared to the CMB-S4 forecasted 95 GHz noise. We expect that the improvement would be much smaller for maps that have been delensed.

Figure 6: Comparison of messenger method and S2hat estimator when it comes to the variance in each bin.

There are several steps that are still needed before this estimator can be used as part of a full Data Challenge analysis:

  • Look into the effect of zeroing signal covariance for ℓ < 30. Is this responsible for the low-ℓ feature in the bandpower window functions?
  • Figure out what is going on with the 10th ℓ bin.
  • Incorporate this filter into a pipeline infrastructure that can run on all maps, take cross-spectra, calculate TT, EE, TE, EB, TB, etc.