## Abstract

Gravitational lensing induces significant errors in the measured distances to high-redshift standard candles and standard sirens such as Type Ia supernovae, gamma-ray bursts and merging supermassive black hole binaries. There will therefore be a significant benefit from correcting for the lensing error by using independent and accurate estimates of the lensing magnification. Here, we investigate how accurately the magnification can be inferred from convergence maps reconstructed from galaxy shear and flexion data. We employ ray-tracing through the Millennium Simulation (MS) to simulate lensing observations in large fields, and perform a weak-lensing reconstruction on the simulated fields. We identify optimal ways to filter the reconstructed convergence maps and to convert them to magnification maps, and analyse the resulting relation between the estimated and true magnification for sources at redshifts *z*_{S}= 1 to 5. We find that a deep shear survey with 100 galaxies arcmin^{−2} can help to reduce the lensing-induced distance errors for standard candles/sirens at redshifts *z*_{S}≈ 1.5 (*z*_{S}≈ 5) on average by 20 per cent (10 per cent), whereas a futuristic survey with shear and flexion estimates from 500 galaxies arcmin^{−2} yields much larger reductions of 50 per cent (35 per cent). For redshifts *z*_{S}≥ 3, a further improvement by ∼5 per cent can be achieved, if the individual redshifts of the galaxies are used in the reconstruction. Moreover, the reconstruction allows one to identify regions for which the convergence is low, and in which an error reduction by up to 75 per cent can be achieved. Such strongly reduced magnification uncertainties will greatly improve the value of high-redshift standard candles/sirens as cosmological probes.

## 1 INTRODUCTION

As suggested by Lemaître (1927) and confirmed by Hubble (1929), there is a correlation between the distances and redshifts of galaxies that arises from the expansion of our Universe: galaxies at greater apparent distance show more redshifted spectral features. The exact relationship between distance and redshift changes for different cosmological theories or different cosmological parameters. Accurate measurements of the distance–redshift relation may therefore help to discriminate between models and to constrain cosmological parameters (Linder 2008).

Distance estimates based on the apparent magnitudes of Type Ia supernova (SN) have provided constraints for the current expansion rate and the mean matter density of our Universe, and substantiated the evidence for the currently favoured Λcold dark matter (ΛCDM) model (e.g. Komatsu et al. 2009), since SN observations indicated a cosmological constant or another dark-energy component is currently accelerating the cosmic expansion (Riess et al. 1998; Perlmutter et al. 1999). In conjunction with other cosmological probes, current SN data even put constraints on the properties of the dark energy (Kowalski et al. 2008; Rubin et al. 2009).

While Type Ia SN can only be seen out to redshifts *z*∼ 2, gamma-ray bursts (GRB) can be detected at much higher redshifts. There is growing evidence for correlations between observed and intrinsic burst properties (e.g. Ghirlanda, Ghisellini & Firmani 2006), with which GRBs can provide distance estimates out to redshifts *z* > 6 (Schaefer 2007). When added to distance data at lower redshift, the higher-redshift bursts help to break parameter degeneracies in cosmological models and make GRBs a valuable discriminant between dark-energy models (Schaefer 2007; Liang et al. 2008; Amati et al. 2008).

Another promising way to obtain very accurate distance measurements in the future are observations of gravitational waves emitted by merging supermassive black hole binaries (MSBs) (Schutz 1986; Holz & Hughes 2005). From the gravitational wave phasing, it is possible to determine the luminosity distance to the source and the redshifted mass, *M*(1 +*z*), to high precision. However, the redshift cannot be measured from the gravitational waves alone, so the use of MSBs as distance probes will rely on the identification of an electromagnetic counterpart to measure the redshift of the merger event (Lang & Hughes 2008). Detection of the gravitational-wave signals from MSBs is one of the main goals of the planned Laser Interferometer Space Antenna1 (LISA). MSBs are very luminous and can be observed out to the cosmic horizon. Current estimates suggest that LISA will see a few tens of events per year, of which most will have distance measurements to less than ∼10 per cent, and of the order of 2 per year will have distance measurements to less than 1 per cent and sky localization to within a square degree (Arun et al. 2009b).

The distance measurements for standard candles like Type Ia SNe, GRBs and standard sirens like MSBs are based on the comparison of the electromagnetic or gravitational radiation energy emitted by the source (assumed to be known at least statistically) and the radiation flux or amplitude received by the observer’s detector. Apart from the emitted signal strength and the distance between source and observer (and other factors), the received signal strength is also affected by gravitational lensing: gravitational deflection by intervening matter structures may focus or defocus the radiation towards the observer, resulting in an increased or decreased detector signal. This gravitational (de-)magnification induces an additional scatter in the distance estimates (see e.g. Holz & Linder 2005, and references therein).

Evidence for gravitational (de-)magnification has been found in the GOODS SN data (Jönsson et al. 2006) and the Supernova Legacy Survey (Jönsson et al. 2010b). The lensing effect is small compared to other sources of uncertainty for current SN samples (e.g. Riess et al. 2004), but it will become significant for large future high-redshift (i.e. with *z*≳ 1.5) SN samples (Holz & Linder 2005; Jönsson et al. 2010b). In particular, pencil-beam surveys might be compromised by gravitational lensing because of the large spatial correlation of the magnification (Cooray, Huterer & Holz 2006).

There is also strong evidence that high-redshift GRBs are significantly affected by gravitational lensing and magnification bias (e.g. Porciani, Viel & Lilly 2007; Wyithe, Oh & Pindor 2010), which may lead to large biases in their deduced distances if not properly accounted for. Moreover, magnification scatter will almost certainly be the dominant source of error in distance measurements using MSBs (Arun et al. 2009a).

While a source of noise for distance measurements, magnification of standard candles/sirens has also been considered a useful signal of the cosmic matter distribution. The observed scatter in SNe brightnesses can be used to constrain the amount of dark matter in the form of massive compact objects (Rauch 1991; Metcalf & Silk 1999; Mörtsell, Goobar & Bergström 2001; Minty, Heavens & Hawkins 2002), or to measure the power spectrum of density fluctuations on small scales (Metcalf 1999) and on larger scales (Dodelson & Vallinotto 2006). Correlations between galaxies and SN brigtnesses can be used to constrain the properties of galaxy haloes (Metcalf 2001; Jönsson et al. 2010a,b).

When measuring distances to standard candles/sirens, one can try to correct for the gravitational lensing effects by inferring the magnification from other observations. For example, Gunnarsson et al. (2006) and Jönsson, Mörtsell & Sollerman (2009) suggested modelling the matter distribution between the observer and a source using a model for the haloes of the observed galaxies near the line of sight (l.o.s). These foreground models could reduce magnification scatter for high-redshift SN by up to a factor of 3. However, the success of this technique relies heavily on the validity of many assumptions about the detailed relation between observed light and total matter.

Dalal et al. (2003) used convergence power spectra to estimate the correlation between the true convergence (which is closely linked to the magnification) and the convergence as reconstructed from background galaxy shear measurements. They found that even with a very high number density of galaxies for the convergence reconstruction, the reduction in the magnification-induced scatter was small. Based on similar calculations, Shapiro et al. (2010) estimated that convergence maps reconstructed using galaxy flexion in addition to shear might help to reduce the lensing-induced distance errors by up to 50 per cent, making this particular ‘delensing’ approach promising.

In this work, we use ray-tracing through the Millennium Simulation (MS; Springel et al. 2005) to investigate how accurately the lensing magnification of standard candles and standard sirens in a ΛCDM universe can be inferred from the shear and flexion measured in the images of distant galaxies. The accuracy with which the magnification can be estimated directly determines the lensing-induced uncertainty in the distances of Type Ia SNe, GRBs and MSBs that remains after delensing, i.e. after a correction for the magnification effects has been applied. In a companion paper (Gair, King & Hilbert, in preparation), we will discuss the consequences of delensing for the use of gravitational-wave sources as cosmological probes in comparison to other probes.

Compared to the magnification correction scheme suggested, e.g. by Gunnarsson et al. (2006), the method discussed here has the advantage that it does not require any assumptions about the relation between the distribution of visible and dark matter. This method consists of (i) reconstructing the convergence towards an SN, GRB or MSB as accurately as possible from the shear and flexion measurements of galaxy images near the line-of-sight, (ii) estimating the magnification from the reconstructed convergence and (iii) correcting the observed SN, GRB or MSB signal using the inferred magnification.

As will be shown below, for the correction to yield satisfactory results, one must reconstruct the convergence on sub-arcmin scales (see also Dalal et al. 2003), where the non-Gaussian nature of the underlying density field becomes important. Moreover, a realistic description of the noise of the convergence reconstruction on these scales has to take into account the discreteness and randomness of the galaxy image positions. Finally, the relation between the magnification and the noisy reconstructed convergence is non-trivial. Such complications usually have to be neglected in a treatment relying on convergence correlations and Gaussian statistics (as was done, e.g., by Dalal et al. 2003; Shapiro et al. 2010). In contrast, all these effects can be included in the ray-tracing simulations used here. This approach not only provides more realistic predictions about the performance of magnification correction schemes, but also an optimized magnification estimate, and more detailed information about the residual magnification after correction. In particular, the simulations yield detailed probability distributions for the magnification and its residual as a function of the reconstructed convergence. Such information is valuable as input for Bayesian parameter estimation for cosmological models, and helps to further reduce lensing-induced errors and biases on cosmological parameters (Hirata, Holz & Cutler 2010; Shang & Haiman 2010).

The paper is organized as follows. In Section 2, we discuss gravitational lensing and how it affects the distance estimates of standard candles and standard sirens. In Section 3, we describe the methods for simulating noise-free lensing maps and for creating shear and flexion maps with realistic noise properties. Moreover, we discuss how the information in the noisy maps is used to estimate the local magnification. Results for the magnification correction are presented in Section 4. The paper concludes with a summary and discussion in Section 5.

## 2 THEORY

### 2.1 Gravitational lensing

The photons and gravitons (and any other particle species, e.g. neutrinos) from a distant source may be deflected gravitationally by intervening matter inhomogeneities before they reach the observer. The deflection, called gravitational lensing (see e.g. Schneider, Kochanek & Wambsganss 2006, for an overview), causes shifts in the observed image position relative to the ‘true’ source position, i.e. the sky position at which the source would be seen in the absence of gravitational lensing. Here, the lensing effects are described by the lens mapping,

which relates the angular image position**θ**= (θ

_{1}, θ

_{2}) of a point-like source at redshift

*z*to its true (unlensed) angular source position

**β**= (β

_{1}, β

_{2}).2

The distortion induced in the images of extended sources like galaxies can be quantified to first order by the Jacobian of the lens mapping:

This equation defines the convergence κ(**θ**,

*z*), the shear γ(

**θ**,

*z*) =γ

_{1}+ iγ

_{2}and the asymmetry ω(

**θ**,

*z*). Higher-order image distortions can be quantified by higher derivatives of the lens mapping, which can be combined, e.g. into the spin-1 flexion and the spin-3 flexion where The (unsigned) image magnification is given by

### 2.2 Lensing effects on distance estimates

The lensing magnification influences the observed signal strength of distant SN, GRBs and MSBs, and thereby the inferred distances (e.g. Gunn 1967; Schneider & Wagoner 1987; Kantowski, Vaughan & Branch 1995; Frieman 1996; Wambsganss et al. 1997). In a nutshell, the radiation power *P*_{S} emitted by a standard candle/siren at redshift *z*_{S} and the power *P*_{R} received by a detector are related by3

*c*

_{R}denotes a detector-specific constant, μ (

**θ**,

*z*

_{S}) the lensing magnification in the direction

**θ**of the image and

*D*

_{lum}the luminosity distance. Hence,

An error δμ in the magnification causes an error δ*D*_{lum} in the luminosity distance:

### 2.3 Quantifying the magnification uncertainty

Delensing methods provide estimates μ_{est} of the true magnification μ of a standard candle/siren. The resulting error of the delensing method is encoded in the distribution of the residual magnification μ_{res}=μ/μ_{est}. A worthwhile delensing method should result in a residual magnification whose statistical dispersion is substantially smaller than the dispersion in the true magnification μ.

In order to quantify the performance of delensing methods, one needs a way to quantify the dispersion in the residual magnification μ_{res} and compare it to the dispersion in the uncorrected magnification μ. A common way to quantify the dispersion of a distribution is the standard deviation. However, for point-like sources, the magnification distribution *p*_{μ}(μ) ∝μ^{−3} for μ≫ 1 and so the standard deviation of the magnification is formally divergent. In this work, we will therefore quantify the dispersion of the magnification using the distribution of the logarithm of the magnification

_{λ}, which is finite for point-like sources. Similarly, the dispersion of the residual magnification μ

_{res}will be quantified by the standard deviation of its logarithm

### 2.4 Magnification estimates from galaxy shear and flexion

There are various methods to obtain an estimate for the magnification μ (**θ**, *z*) for a given l.o.s **θ** and redshift *z*. One can, for example, try to infer the matter distribution near that l.o.s from the observed distribution of mass tracers like galaxies, and then calculate the expected magnification μ (**θ**, *z*) from the inferred matter distribution (e.g. Gunnarsson et al. 2006). One can also try to infer the magnification from source number density counts (e.g. Broadhurst, Taylor & Peacock 1995; Zhang & Pen 2005), or the image sizes of extended sources (e.g. Bartelmann & Narayan 1995).

Here, we focus on methods that use weak-lensing reconstruction (Kaiser & Squires 1993; Bacon et al. 2006) to obtain magnification estimates (see also Dalal et al. 2003; Shapiro et al. 2010). These methods ‘reconstruct’ the convergence from the shear and/or flexion measured in the images of distant galaxies and use the result to calculate the magnification. In their conventional form, they neglect the asymmetry, and assume that the convergence, shear and flexion are well approximated by derivatives of a common lens potential ψ(**θ**, *z*):4

**ℓ**= (ℓ

_{1}, ℓ

_{1}) denotes the two-dimensional Fourier vector, ℓ=ℓ

_{1}+ iℓ

_{2}denotes the complex Fourier wavenumber and an asterisk denotes complex conjugation.5 The reconstructed convergence is then translated into a magnification estimate via an approximate version of equation (6) applicable in the limit of weak lensing: The magnification estimate μ

_{est}(

**θ**,

*z*) is then used to ‘delens’ the standard candle/siren.

There are several complications in practice. First, neither the shear γ, nor the flexion and can be directly measured, but only their reduced versions *g*=γ/(1 −κ), *F*=∇^{−}_{θ}*g* and *G*=∇^{+}_{θ}*g* (Schneider & Seitz 1995; Schneider & Er 2008). This complication can be taken into account, e.g., by iterative reconstruction methods (Seitz & Schneider 1995). Moreover, γ≈*g*, and for most parts of the sky. It is thus assumed in the following that galaxy shapes provide estimates for the shear and flexion (and we postpone the proper treatment of reduced shear and flexion to forthcoming studies).

Even from a perfect shear or flexion map, the convergence can only be reconstructed up to a constant because of the mass-sheet degeneracy (Falco, Gorenstein & Shapiro 1985). In addition, the boundary conditions influence the reconstruction near the edges of finite fields. These problems can, however, be alleviated by using a large field of view for the reconstruction (whose mean convergence is close enough to zero, as discussed by Shapiro et al. 2010) and special finite-field inversion techniques (e.g. Seitz & Schneider 1996).

Furthermore, the galaxies that can be used to measure the shear and flexion have a finite number density *n*_{gal} and thus only provide shear and flexion estimates at a finite number of discrete and randomly distributed points. Moreover, the shape of a galaxy image provides a very noisy estimate for the shear and flexion. Therefore, spatial interpolation and averaging are necessary to obtain a convergence estimate with acceptable signal-to-noise ratio in the desired direction of a standard candle/siren. The smoothing erases real structure on small scales, which causes additional deviations of the reconstructed convergence from the ‘true’ convergence. The optimal smoothing scale is determined by a trade-off between the aim to reconstruct as much small-scale structure of the convergence as possible and to average over as many galaxy images as possible, so as to reduce the noise due to the dispersion in their intrinsic shapes (Dalal et al. 2003).

Finally, the galaxies do not all lie at the redshift *z*_{S} of the standard candle/siren, but have a certain redshift distribution *p*_{gal}(*z*_{gal}) depending on their intrinsic redshift distribution and on the depth of the survey. A reconstruction scheme not using individual galaxy redshifts6 only yields a noisy and smoothed version of the effective convergence:

*p*

_{gal}(

*z*

_{gal}) is not sharply peaked around the redshift

*z*

_{S}of the standard candle/siren, the effective convergence κ

_{eff}(

**θ**) may deviate substantially from the convergence κ(

**θ**,

*z*

_{S}), which may cause a systematic as well as a statistical error in the reconstruction of κ(

**θ**,

*z*

_{S}). Spatial variations of the ‘local’ redshift distribution of the galaxies constitute an additional source of noise.

## 3 METHODS

The complications discussed above limit the accuracy with which the magnification can be estimated from the weak-lensing reconstruction. Therefore, accurate estimates of their effects are needed in order to evaluate the performance of the weak-lensing reconstruction. Since it is difficult to obtain accurate estimates for all these effects by analytical calculations, we use a numerical approach.

Using ray-tracing through structure-formation simulations, we create a suite of simulated fields of view populated with galaxy images at random positions with noisy estimates of the local shear and flexion. The simulated galaxy images are then used to reconstruct the convergence in the simulated fields, and the reconstructed convergence is used to calculate an estimate of the magnification. The ‘true’ magnification (obtained from the ray-tracing) in the field is then corrected by the magnification estimate from the reconstruction, and the resulting residual magnification is analysed.

### 3.1 The ray-tracing

Here, the MS by Springel et al. (2005), a large high-resolution *N*-body simulation of cosmic structure formation, is used to simulate the matter distribution between observer and source. The cosmological parameters for the MS are: a matter density Ω_{M} = 0.25 and a cosmological-constant energy density Ω_{Λ} = 0.75 (in units of the critical density), a Hubble constant *h* = 0.73 (in units of 100 km s^{−1} Mpc^{−1}), a primordial spectral index *n* = 1 and a normalization parameter σ_{8} = 0.9 for the linear density power spectrum. The simulation was run using a parallel TreePM version of gadget2 (Springel 2005) with *N*_{p} = 2160^{3} particles of mass *m*_{p} = 8.6 × 10^{8}*h*^{−1} M_{⊙} in a cubic box with comoving side length *L* = 500 *h*^{−1} Mpc, and an effective force softening length ε = 5 *h*^{−1} kpc.

The gravitational lensing effects from the matter structures in the MS are calculated by the Multiple-Lens-Plane ray-tracing algorithm described in Hilbert et al. (2009). The algorithm takes into account the lensing effects of the dark matter structures on scales ≳5 *h*^{−1} kpc, which are represented by the simulation particles in the MS. In addition, the effects of the stars in galaxies with stellar masses ≥10^{9}*h*^{−1} M_{⊙}[as predicted by the model of De Lucia & Blaizot (2007)] are taken into account as described in Hilbert et al. (2008).

The multi-plane algorithm is used to simulate 32 fields of view, each with an area of 4 × 4 deg^{2} (providing 512 deg^{2} total area) and covered with a regular grid of 4096^{2} pixels (providing a resolution of 3.5 arcsec) in the image plane. For each pixel, a ray is traced back through the MS by the algorithm to calculate the magnification, convergence, shear and flexion for sources on each of the 44 lens planes that span the redshift range from *z* = 0 to 5.7.

Every pixel of the ray-tracing fields [excluding a 15 arcmin margin, which might be affected by artefacts in the weak-lensing reconstruction, and strong-lensing regions with or ] is used as a sample line-of-sight towards a standard candles/siren. Here, we consider only volume-limited samples of standard candles/sirens. Thus, each pixel is weighted in the statistical analysis by its inverse magnification to account for the magnification bias (Canizares 1981; Hilbert et al. 2007b).

### 3.2 The simulated weak-lensing surveys

Simulated catalogues of lensed galaxy images with a given number density *n*_{gal} are generated with random sky positions uniformly distributed in the fields of view. The redshifts of the simulated galaxies are drawn from a distribution that matches observations (Brainerd, Blandford & Smail 1996)

*z*

_{0}are parameters (with

*z*

_{0}proportional to the median redshift of the simulated survey).

Here, we consider three idealized weak-lensing galaxy surveys: an *advanced survey*, a *futuristic survey* and a *perfect survey*. For the advanced survey, we assume a galaxy density *n*_{gal} = 100 arcmin^{−2} and a redshift distribution with α = 2, β = 3/2 and median redshift *z*_{median} = 1.5 appropriate for a deep space-based lensing survey (cf. e.g. Schrabback et al. 2010). For the futuristic survey, we assume a very high density *n*_{gal} = 500 arcmin^{−2} of usable galaxy images having a redshift distribution with α = 0.8, β = 2 and *z*_{median} = 1.8 appropriate for an ultra-deep survey (Coe et al. 2006) with extremely high spatial resolution.7 In addition, we consider a ‘perfect’ survey, whose noise-free convergence maps are directly created from the ray-tracing.

For the advanced and futuristic surveys, we consider both the case that only shear estimates are used, and the case that shear estimates are combined with flexion estimates. The shear and flexion estimates of the simulated galaxies are obtained from interpolating the shear and flexion from the ray-tracing on to the galaxy positions and redshifts. The shape noise in each galaxy image is simulated by adding a random number drawn from a normal distribution with standard deviation , and , to each component of γ, and , respectively (Rowe et al., unpublished; see Shapiro et al. 2010).

### 3.3 The weak-lensing reconstruction

For the weak-lensing reconstruction, we consider a mesh-based method that allows one to employ Fast Fourier Transforms (FFT). Each field of view is covered with a regular mesh of 4096^{2} pixels (i.e. the same mesh geometry as for the ray-tracing). In each pixel, the shear γ is estimated by weighted sums over the shear estimates γ^{(i)}_{gal} of the simulated galaxy images in the field:

*w*

^{(i)}

_{gal}are determined by8 where

**θ**denotes the sky position of the pixel centre, the

**θ**

^{(i)}

_{gal}denotes the sky positions of the galaxy images, and θ

_{w}= 1.75 arcsec denotes a weighting scale, which is chosen slightly smaller than the pixel size. The shear estimate on the regular mesh is then Fourier transformed by FFT methods (Frigo & Johnson 2005), and converted into a convergence estimate using equation (14a) and setting . If only shear information is used, is used directly as an estimate of the ‘raw’ convergence in Fourier space prior to additional smoothing:

In the case that flexion information is used as well, estimates and of the Fourier-space convergence from the galaxy flexion and are computed in a procedure analogous to that for . The convergence estimates from shear and flexion are then combined into a joint estimate by (Okura, Umetsu & Futamase 2007)

The smoothing inherent in the averaging (18) may be insufficient to reach an acceptable signal-to-noise ratio of the convergence estimate in real space. The raw convergence estimate is thus smoothed by a Gaussian low-pass filter with filter scale θ_{s}, i.e.

### 3.4 Magnification estimates from noisy convergence maps

The convergence map generated from the weak-lensing reconstruction can be converted into a map of estimated magnification in several ways. If the estimated convergence κ_{est}(**θ**) is close to true convergence κ(**θ**, *z*_{S}), and if the shear and rotation are small,

**θ**,

*z*

_{S}) of a standard candle/siren at position

**θ**and redshift

*z*

_{S}.10 This simple estimate might however fail, if the estimated convergence κ

_{est}(

**θ**) differs substantially from the convergence κ(

**θ**,

*z*

_{S}), e.g. because of shape noise or because the weak-lensing survey probes a redshift range very different from the redshift

*z*

_{S}of the standard candle/siren. In certain cases, the simple estimate may perform even worse than simply ignoring lensing and assuming λ

_{est}= 0 (see Section 4.2).

If the conditional distribution of the true magnification λ for a given estimated convergence κ_{est} is known, one can construct a bias-free magnification estimate that minimizes the dispersion in the residual magnification by (see Appendix A)

_{est}: This estimate can be computed from the lensing simulations by spatial averages over the simulated fields. The estimate is optimal in the sense that no other magnification estimate based on the estimated convergence yields a smaller dispersion in the residual magnification. For example, the resulting dispersion in the residual magnification is never larger than the dispersion in the uncorrected magnification (i.e. assuming λ

_{est}= 0).

## 4 RESULTS

### 4.1 Perfect reconstruction

We first consider the case that one can somehow obtain a perfect estimate of the true convergence κ(**θ**, *z*_{S}) for sources at the same position **θ** and redshift *z*_{S} as the standard candle/siren. This case provides hard limits to what can be gained by delensing in more realistic cases.

The joint distribution *p*_{λ,κ}(μ, κ) of the logarithmic magnification λ = ln (μ) and convergence κ for sources at redshift *z*_{S} = 1.5 is shown in Fig. 1. The joint distribution is almost degenerate with the probability concentrated around the relation λ=−2 ln(1 −κ). This indicates that one can get a very good magnification estimate from equation (25), if the convergence can be reconstructed with sufficient accuracy. Moreover, the optimal estimate (25) is virtually identical to the simple estimate (24).

The effect of delensing using a perfect convergence estimate is illustrated in Fig. 2. The distribution of the uncorrected residual λ_{res}=λ for standard candles/sirens at redshift *z*_{S} = 1.5 has a standard deviation . The corrected residual λ_{res}=λ−λ_{est} using the optimal estimate (25) and the convergence κ_{est}(**θ**) =κ(**θ**, *z*_{S}) has a 15 times smaller standard deviation . The small but non-vanishing residual dispersion is due to the fact that the magnification also depends on the shear, but this dependence is ignored in the estimate (25).11

Even with perfect measurements for individual galaxies, a magnification estimate will make use of galaxies spread over a certain patch of the sky. This amounts to averaging or smoothing the convergence over the area occupied by the galaxies. The impact of smoothing on the dispersion of the residual magnification is shown in Fig. 3. The magnification correction is already substantially degraded (reaching 50 per cent of the uncorrected dispersion), if a smoothed version of the convergence with a filter scale θ_{s} = 10 arcsec is used. This illustrates the need to faithfully reconstruct the convergence on scales of a few arcsec, if one wants to decrease the dispersion in the residual magnification by a factor of 2 compared to the uncorrected magnification.

### 4.2 Realistic reconstruction

As a more realistic scenario, we assume that the convergence κ_{est} is reconstructed from the shear measured in an advanced survey with a galaxy density *n*_{gal} = 100 arcmin^{−2} and median redshift *z*_{median} = 1.5. The joint distribution of the logarithmic magnification λ for sources at redshift *z*_{S} = 1.5 and the estimated convergence κ_{est} is shown in Fig. 4. The joint distribution roughly follows the relation λ_{est}=−2 ln (1 −κ_{est}), but there is a large scatter around it. Moreover, the mean as a function of the estimated convergence κ_{est} deviates substantially from that relation, in particular for κ≲ 0. This shows that the estimate (24) may differ substantially from the optimal estimate (25) for a realistic noise level.

Fig. 5 illustrates how much the dispersion in the residual magnification λ_{res} of a standard candle/siren at *z*_{S} = 1.5 can be reduced with an advanced survey for particular choices of the filter scale θ_{s}. For θ_{s}≥ 30 arcsec, both estimates (24) and (25) yield a similar reduction in the residual dispersion. For θ_{s} < 30 arcsec, however, the optimal estimate (25) performs significantly better than the simple estimate (24).

The optimal estimate always yields a residual dispersion smaller than the uncorrected dispersion σ_{λ}, but the simple estimate results in for θ_{s}≲ 10 arcsec if only shear data are used. In that case, the noise in the reconstructed convergence is much larger than the signal (i.e. the true convergence). The simple estimate translates this noise into a large noise in the estimated magnification, which thus acquires a dispersion exceeding the dispersion of the true magnification. In contrast, the optimal magnification estimate responds more weakly to the noisy convergence and thus keeps the residual dispersion below the uncorrected dispersion.

If only shear data are available, the residual dispersion for sources at *z*_{S} = 1.5 is reduced to 81 per cent of the uncorrected dispersion σ_{λ}, when the simple estimate and an optimal filter scale θ_{s}≈ 30 arcsec is used. The optimal estimate yields a slightly smaller residual dispersion at the optimal filter scale θ_{s}≈ 25 arcsec. Further improvement is obtained if flexion information is available in addition to the shear. In this case, the residual dispersion is reduced to 76 per cent by the simple estimate and a filter scale θ_{s}≈ 15 arcsec. The optimal estimate (25) performs best at θ_{s}≈ 5 arcsec, i.e. at the mean separation of the galaxy images. The residual dispersion is then 70 per cent of the uncorrected dispersion.

In Fig. 6, the probability distribution of the uncorrected magnification is compared to the distribution of the residual magnification using the optimal estimate (25) for correction. The residual distribution is not only narrower, but also less skewed than the distribution of the uncorrected magnification, making it a better candidate for a Gaussian approximation.

In a statistical analysis, one might prefer to use the individual probability distributions of the residuals λ_{res, i} appropriate for the individual convergence estimates κ_{est, i} instead of a common residual distribution . As Fig. 6 shows, the conditional distribution for an estimated convergence κ_{est}=−0.05 is very narrow with a dispersion that is only 45 per cent of the dispersion of the distribution of the magnification over the full sky. A standard siren with a convergence estimate that low may thus provide substantially tighter constraints on cosmological parameters than a standard siren without a convergence estimate. On the other hand, a convergence estimate κ_{est} = 0.1 indicates a very broad magnification distribution, which yields a residual dispersion that is twice the dispersion of the full-sky magnification distribution. Knowledge of such a high convergence estimate for a standard siren may help to avoid biases and underestimated errors on its distance due to lensing.

The dispersion of the conditional probability distribution as a function of the estimated convergence κ_{est} from an advanced galaxy-shear survey is shown in Fig. 7. This dispersion is the same for both the simple estimate (24) and the optimal estimate (25) (see Appendix A). The simple estimate, however, produces a conditional bias , which is absent (by construction) for the optimal estimate.

The small residual dispersion in regions with low values of the estimated convergence appears much more encouraging than the all-sky average residual dispersion (compare e.g. the 45 per cent residual for κ_{est}=−0.05 to the all-sky average residual of 78 per cent a shear survey). The question is how abundant are regions with small residual dispersion. Fig. 8 shows that the distribution of the conditional residual dispersion is very skewed. Values substantially below the all-sky average are common. For example, the median is at for an advanced shear survey, which is 10 per cent below the all-sky average.

As Fig. 9 illustrates, there is little benefit from the magnification correction for standard candles/sirens at redshifts *z*_{S} much smaller than the median redshift *z*_{median} = 1.5 of the weak-lensing survey. For *z*_{S}≲ 0.5, a substantial part of the reconstructed convergence is due to matter structures at or above *z*_{S}. These matter structures shear most galaxy images used for the convergence reconstruction, but do not (de-)magnify the standard candle/siren, and thus merely act as noise in the magnification estimation.

In contrast, standard candles/sirens at redshifts *z*_{S} > *z*_{median} do benefit from delensing. The residual dispersion for sources at *z*_{S} = 3.1 can be reduced to 85 per cent of the dispersion σ_{λ} for the uncorrected magnification, if only shear information is available. If flexion can be used in addition, the dispersion can be further reduced to 80 per cent of the uncorrected dispersion.

Even for standard candles/sirens at redshift *z*_{S} = 5.3, there is a noticeable reduction in the residual dispersion. The magnification correction based on shear yields a residual dispersion for the best filter scale θ_{s} = 25 arcsec. The best correction using shear and flexion reduces the residual dispersion to 85 per cent of the uncorrected dispersion.

The distributions of the lensing-induced distance errors δ*D*_{lum} are shown in Fig. 10 for sources at *z*_{S} = 1.5. Before correction, only 50 per cent of the standard candles/sirens have a relative distance error ≤2 per cent. After correction with shear data from an advanced survey, the fraction rises to 69 per cent. In regions with κ_{est}=−0.05, 90 per cent of the sources have a lensing-induced distance error below 2 per cent. The fraction of sources with absolute lensing-induced distance error below a given threshold before and after correction is listed in Table 1 for several source redshifts.

ɛ≤ 0.01 | ɛ≤ 0.02 | ɛ≤ 0.05 | ɛ≤ 0.10 | |

z_{S} = 1.0 | 0.41/0.60 | 0.80/0.87 | 0.96/0.98 | 0.99/1.00 |

z_{S} = 1.5 | 0.25/0.38 | 0.50/0.69 | 0.92/0.95 | 0.98/0.99 |

z_{S} = 2.1 | 0.18/0.27 | 0.37/0.51 | 0.82/0.89 | 0.96/0.98 |

z_{S} = 3.1 | 0.13/0.18 | 0.27/0.36 | 0.65/0.76 | 0.93/0.95 |

z_{S} = 4.2 | 0.11/0.14 | 0.22/0.28 | 0.54/0.65 | 0.88/0.92 |

z_{S} = 5.3 | 0.10/0.12 | 0.20/0.25 | 0.49/0.58 | 0.83/0.88 |

ɛ≤ 0.01 | ɛ≤ 0.02 | ɛ≤ 0.05 | ɛ≤ 0.10 | |

z_{S} = 1.0 | 0.41/0.60 | 0.80/0.87 | 0.96/0.98 | 0.99/1.00 |

z_{S} = 1.5 | 0.25/0.38 | 0.50/0.69 | 0.92/0.95 | 0.98/0.99 |

z_{S} = 2.1 | 0.18/0.27 | 0.37/0.51 | 0.82/0.89 | 0.96/0.98 |

z_{S} = 3.1 | 0.13/0.18 | 0.27/0.36 | 0.65/0.76 | 0.93/0.95 |

z_{S} = 4.2 | 0.11/0.14 | 0.22/0.28 | 0.54/0.65 | 0.88/0.92 |

z_{S} = 5.3 | 0.10/0.12 | 0.20/0.25 | 0.49/0.58 | 0.83/0.88 |

### 4.3 Futuristic reconstruction

Improvements in observation instruments and techniques might one day permit weak-lensing surveys with very high galaxy number densities. As a futuristic scenario, we consider a very deep high-resolution survey that provides shear and flexion estimates from galaxies with a density *n*_{gal} = 500 arcmin^{−2} and median redshift *z*_{median} = 1.8.

As Fig. 11 shows, the high number density allows one to substantially reduce the residual dispersion for standard candles/sirens at *z*_{S} = 1.5 at small smoothing scales θ_{s}. If only shear data are used, the residual dispersion can be reduced by delensing to 68 per cent of the uncorrected dispersion σ_{λ} at θ_{s} = 10 arcsec. If shear and flexion data are used, the residual dispersion is 0.04 at θ_{s} = 3 arcsec, which is only 54 per cent of the uncorrected dispersion. To reach a similar statistical uncertainty due to gravitational magnification without delensing, one would need at least a four times higher number of similar standard candles/sirens.

For low values of the estimated convergence κ_{est}, the residual dispersion is even lower, as can be seen in Fig. 12. For example, the residual dispersion for κ_{est}=−0.05 is only 25 per cent of the unconditional uncorrected dispersion σ_{λ}.

Fig. 13 illustrates that a futuristic survey may also help to substantially reduce the magnifications scatter for high-redshift standard candles/sirens. For example, the residual dispersion for sources at redshift *z*_{S} = 2.1 can be reduced to 50 per cent of the uncorrected dispersion with a futuristic survey measuring shear and flexion. This is even better than for the sources at redshift *z*_{S} = 1.5. For *z*_{S} = 5.3, the residual dispersion can be reduced to 67 per cent of the uncorrected dispersion.

Fig. 14 shows for sources at *z*_{S} = 1.5, how well a futuristic survey with shear and flexion data can help to mitigate the lensing effects on distance errors. While the fraction of uncorrected standard candles/sirens with relative distance error ≤2 per cent is only 50 per cent, the fraction of corrected standard candles/sirens is 82 per cent. If only regions with κ_{est}=−0.05 are considered, 97 per cent of the sources have residual distance errors ≤2 per cent. Results for several distance error thresholds and source redshifts are listed in Table 2.

ɛ≤ 0.01 | ɛ≤ 0.02 | ɛ≤ 0.05 | ɛ≤ 0.10 | |

z_{S} = 1.0 | 0.41/0.64 | 0.80/0.88 | 0.96/0.98 | 0.99/1.00 |

z_{S} = 1.5 | 0.25/0.53 | 0.50/0.82 | 0.92/0.98 | 0.98/1.00 |

z_{S} = 2.1 | 0.18/0.43 | 0.37/0.73 | 0.82/0.97 | 0.96/0.99 |

z_{S} = 3.1 | 0.13/0.29 | 0.27/0.55 | 0.65/0.91 | 0.93/0.98 |

z_{S} = 4.2 | 0.11/0.21 | 0.22/0.41 | 0.54/0.81 | 0.88/0.97 |

z_{S} = 5.3 | 0.10/0.18 | 0.20/0.34 | 0.49/0.73 | 0.83/0.94 |

ɛ≤ 0.01 | ɛ≤ 0.02 | ɛ≤ 0.05 | ɛ≤ 0.10 | |

z_{S} = 1.0 | 0.41/0.64 | 0.80/0.88 | 0.96/0.98 | 0.99/1.00 |

z_{S} = 1.5 | 0.25/0.53 | 0.50/0.82 | 0.92/0.98 | 0.98/1.00 |

z_{S} = 2.1 | 0.18/0.43 | 0.37/0.73 | 0.82/0.97 | 0.96/0.99 |

z_{S} = 3.1 | 0.13/0.29 | 0.27/0.55 | 0.65/0.91 | 0.93/0.98 |

z_{S} = 4.2 | 0.11/0.21 | 0.22/0.41 | 0.54/0.81 | 0.88/0.97 |

z_{S} = 5.3 | 0.10/0.18 | 0.20/0.34 | 0.49/0.73 | 0.83/0.94 |

### 4.4 Improving the reconstruction with Wiener filters

Using a Gaussian filter to smooth the reconstructed convergence [cf. equation (23)] might not be the best way to exploit the spatial correlation in the convergence field. With a few assumptions, choosing the optimal filter for the reconstructed convergence becomes a text-book problem on Wiener filters (Wiener 1949).

Consider the unfiltered convergence κ_{raw} reconstructed from galaxy shear or shear and flexion as a raw estimate for the convergence κ(*z*_{S}) to a standard candle/siren at redshift *z*_{S}. Let denote the power spectrum of κ_{raw}, and denote the cross power spectrum of κ(*z*_{S}) and κ_{raw}. Then

*z*

_{S}) and estimated convergence κ

_{est}(

**θ**), given in Fourier space by

The Wiener filter (27) can be constructed by measuring the power spectra in the simulated fields and approximating their ratios with a suitable function (e.g. a spline). The filters for standard candles/sirens at redshift *z*_{S} = 1.5 are shown in Fig. 15 for the advanced and the futuristic survey.

Using Wiener filters for the estimated convergence improves the dispersion in the residual magnification only marginally compared to the best Gaussian smoothing. For an advanced survey with *n*_{gal} = 100 arcmin^{−2} with shear data, the Wiener filter yields a residual dispersion per cent of the uncorrected dispersion σ_{λ}, whereas the Gaussian filter with θ_{s} = 25 arcsec yields a residual dispersion per cent. For a futuristic survey with shear and flexion, the residual dispersion is 53 per cent of uncorrected dispersion for the Wiener filter, which is to be compared to 54 per cent for the best Gaussian filter.

### 4.5 Improving the reconstruction with individual galaxy redshifts

The image distortion for a galaxy at redshift *z*, and hence the information in the galaxy image about the magnification at the redshift *z*_{S} of a standard candle/siren, is not uniform in redshift *z*. In a full tomographic analysis, the variation of the lensing signal with redshift is used to perform a three-dimensional reconstruction of the matter structures in the light cone (e.g. Massey et al. 2007). The reconstructed three-dimensional matter distribution can then be used to estimate the magnification for a given sky position and redshift. Here, we take a simpler approach, which does not try to locate the actual matter structures causing the lensing in redshift, but only exploits the statistical relation between lensing quantities at different redshifts.

We start from the same assumptions used for the simulated the weak-lensing surveys (see Section 3.2): the image shape of a galaxy at sky position **θ**_{gal} and redshift *z*_{gal} provides noisy but unbiased estimates γ_{gal}, and of the shear γ(**θ**_{gal}, *z*_{gal}) and flexion and to the galaxy redshift *z*_{gal}. The error in these estimates is simply the shape noise with vanishing mean. Considered as estimates for the shear and flexion γ(**θ**_{gal}, *z*_{S}), and at the redshift *z*_{S} of a standard candle/siren, γ_{gal}, and acquire an additional error, namely the deviation between the shear and flexion at different redshifts. In the following discussion, this deviation is split into a systematic (i.e. zero-scatter) and a statistical (i.e. zero-mean) component.

The first step towards an improved reconstruction aims at eliminating the systematic deviation. As Fig. 16 illustrates, the shear values for two different redshifts along the same l.o.s are strongly correlated, but on average, the shear to the lower redshift is smaller in magnitude. Fig. 16 also shows that the mean of the shear γ(*z*) to redshift *z* for given shear γ(*z*_{S}) to redshift *z*_{S} along the same l.o.s is well approximated by the linear relation

*r*

_{γ}(

*z*,

*z*

_{S}) (see Fig. 17). Moreover, with factors and very similar to

*r*

_{γ}(

*z*,

*z*

_{S}). Thus, one can construct unbiased estimates γ

_{gal}(

*z*

_{S}), and of the shear and flexion at redshift

*z*

_{S}by

In a second step, the statistical weights of the galaxies in the reconstruction are extended to take into account the redshift dependence of the error in the scaled estimates (30). The error in these estimates has two components: the shape-noise and the scatter around the mean relation between the lensing quantities at different redshifts. The shape noise in the scaled estimate is simply the shape noise in the unscaled estimate (de-)amplified by the proportionality factor *r*_{γ}(*z*, *z*_{S}), or , and has no spatial correlation prior to smoothing. The scatter around the mean relation between shear and flexion at different redshifts has a quite different redshift dependence (e.g. it vanishes when *z*_{gal}=*z*_{S}), and has a finite spatial correlation inherited from the intrinsic spatial correlation of the shear and flexion at a single redshift. As a consequence, the optimal redshift weights depend on the galaxy number density and the spatial smoothing. However, an examination of the optimal weights (which can be derived in a lengthy calculation) reveals that the contribution from the scatter around the mean relation is much smaller than the shape-noise contribution for the smoothing scales and number densities of interest (at least for *z*≲*z*_{S}). Thus, one can approximate the redshift weights by

Optimal use of the scaled estimates (30) and redshift-dependent weights (31) requires that the information about the error of the scaled estimates is still available for the spatial smoothing of the resulting fields. Thus, the reconstruction algorithm discussed in Section 3.3 is modified by merging the spatial-filtering step with the step where the galaxy estimates are projected on to a regular mesh. Since the smoothing is now computed in real space, the algorithm is much slower than the one described in Section 3.3, in particular for larger smoothing scales.

For standard candles/sirens at redshift *z*_{S} = 1.5, there is no improvement in the reconstruction from an advanced or futuristic survey (shown in Fig. 18). This is different for higher redshifts. For *z*_{S} = 3.1, the reconstruction from the shear and flexion of a futuristic survey changes from 57 to 52 per cent of the uncorrected dispersion if redshift weights are used. For *z*_{S} = 5.3, redshift weighting improves the residual dispersion from 67 to 62 per cent.

## 5 SUMMARY AND DISCUSSION

Unless corrected for, gravitational lensing induces significant errors in the measured distances of high-redshift standard candles and standard sirens. In this work, we have used numerical simulations to investigate how much these distance errors can be reduced with weak-lensing reconstruction. The method considered comprises (i) reconstructing the convergence towards a standard candle/siren from the shear and flexion measured in a galaxy lensing survey; (ii) estimating the magnification from the reconstructed convergence and (iii) correcting the observed signal of the standard candle/siren using the inferred magnification.

By measuring the relation between the reconstructed convergence and the magnification, we have constructed an optimized magnification estimate that is unbiased and minimizes the residual magnification errors. Furthermore, we have studied the optimal smoothing scale for the weak-lensing reconstruction under various survey conditions.

For an advanced shear survey with *n*_{gal} = 100 arcmin^{−2}, we find that the lensing-induced distance errors for standard candles/sirens at redshifts *z*_{S}≈ 1.5 are reduced on average by 20 per cent. This confirms earlier findings by Dalal et al. (2003) that reconstructions based on such surveys do not significantly reduce the lensing errors on average. However, in regions with low estimated convergence κ_{est}, the residual magnification uncertainty is substantially smaller than in regions of high convergence (e.g. only 40 per cent of the uncorrected error for κ_{est}=−0.05 compared to 200 per cent for κ_{est} = 0.1). Thus, a weak-lensing survey is useful to identify standard candles/sirens in regions with low (high) convergence and small (large) magnification errors, which can then be given larger (smaller) weights in a statistical analysis.

As already pointed out by Shapiro et al. (2010), the correction from weak-lensing reconstruction can be improved considerably by including flexion measurements and greatly increasing the galaxy number density. For example, a futuristic shear and flexion survey with *n*_{gal} = 500 arcmin^{−2} yields error reductions of 50 per cent for standard candles/sirens at *z*_{S}∼ 1.5, and 35 per cent for sources at *z*_{S}∼ 5. In low-convergence regions, the errors can be reduced by up to 75 per cent. For example, the residual distance errors are below 2 per cent for over 97 per cent of the standard candles/sirens in regions with κ_{est}=−0.05. Such lensing-corrected standard candles/sirens would constitute very competitive distance indicators (but one should keep in mind that these numbers are based on very optimistic assumptions about the properties of future surveys).

Our simulation provides detailed statistical information about the magnification-induced distance errors before and after correction, in particular their probability distributions as a function of the estimated convergence. The distributions are valuable for Bayesian parameter estimation and model selection. In a forthcoming paper (Gair, King & Hilbert, in preparation), we will discuss the resulting implications for the use of high-redshift standard sirens as cosmological probes.

In this paper, we have considered several ways to improve the accuracy of the magnification correction scheme. Wiener filters constructed from the measured (cross-)power spectra of the true and reconstructed convergence are expected to provide the optimal filtering of the noisy convergence maps. However, in our simulations, they perform only marginally better than Gaussian filters with suitable filter scale.

Furthermore, we have investigated a simple method employing redshift-dependent weights for the galaxies to improve the weak-lensing reconstruction. While standard candles/sirens at redshifts *z*_{S}≤ 2 show no benefit from this method, magnification errors for higher redshifts are reduced by an additional 5 per cent. Further improvement might come from a tomographic reconstruction (Simon, Taylor & Hartlap 2009).

In contrast to correction schemes based on modelling the foreground matter structures from the observed light (e.g. Gunnarsson et al. 2006), the method discussed here has the advantage that it does not require any assumptions about the relation between visible and dark matter. On the other hand, the light distribution contains valuable information about the matter distribution and the magnification. A better magnification correction might be obtained by inferring the foreground matter distribution from both the observed properties of galaxies along the l.o.s and the shear and flexion information from distant galaxies. Additional information about the matter distribution at redshifts beyond those probed by conventional galaxy weak lensing and flexion could be gathered from observations of lensing of the cosmic microwave background (Lewis & Challinor 2006) or high-redshift 21-cm radiation (Hilbert, Metcalf & White 2007a).

In our simulations, we have fully taken into account many aspects of weak-lensing galaxy surveys that impact the accuracy of the correction. These include e.g. the non-Gaussian nature of the convergence field, the randomness and discreteness of the galaxy redshifts and image positions, and the complex relation between the reconstructed convergence and the magnification. Thus, our studies provide more realistic predictions about the accuracy of the correction than earlier studies relying on convergence power spectra.

However, our approach neglects several complications that affect the correction. Future studies should include the effects of observing reduced shear and flexion. The impact of source clustering and intrinsic alignment on the weak-lensing reconstruction must be investigated.

Our simulations do not include the effects of lensing by structures on scales below the resolution of the MS (i.e. dark matter structures on scales <5 *h*^{−1} kpc or luminous structures with masses <10^{9}*h*^{−1} M_{⊙}). Such structures could affect the magnification of SNe, GRBs and SMBs, but it would be difficult to recover them in a weak-lensing mass reconstruction. The resulting increase in the uncorrected and residual magnification error should be investigated, possibly with higher-resolution simulations. One should also consider using the observed scatter in samples of standard candles/sirens to constrain the small-scale matter fluctuations missed by the simulations.

Finally, the cosmology dependence of the correction should be explored. For example, a higher/lower normalization σ_{8} increases/decreases both the uncorrected and the residual magnification dispersion. Moreover, errors in the assumed cosmology lead to a suboptimal magnification estimator and thus increase the residual magnification error and might also introduce a bias. The resulting degradation should be quantified in future studies. One should also investigate how well one could detect a possible bias in the magnification estimates by looking at differences between the expected and observed distributions of the convergence and magnification estimates.

We thank Xinzhong Er, Jan Hartlap, Antony Lewis, Peter Schneider and Simon White for helpful discussions. This work was supported by the DFG within the Priority Programme 1177 under the projects SCHN 342/6 and WH 6/3 (SH), and by the Royal Society (JRG and LJK).

*P*

_{R}are measured for Type Ia SN and GRBs, while gravitational-wave detectors record wave amplitudes . This difference does, however, not affect the resulting relation between inferred distances and magnification.

## REFERENCES

*et al.*,

## Appendix

### APPENDIX A: MORE ABOUT MAGNIFICATION ESTIMATES FROM NOISY CONVERGENCE MAPS

Define for any two random variables *x* and *y* with joint probability density function (PDF) *p*_{x, y}(*x*, *y*) and conditional PDF *p*_{x|y}(*x*|*y*), and any function *f*(*x*, *y*) as short-hand notation

*f*, and for the conditional mean of

*f*for given

*y*. Furthermore, define for the full variance of

*f*, and for the variance of

*f*restricted to a fixed

*y*.

Consider an ensemble of l.o.s., where each l.o.s. is characterized by its (logarithmic) magnification λ and its estimated convergence κ_{est}. Assume that the joint PDF of λ and κ_{est} is known for the ensemble, which implies that the marginal and conditional distributions of λ and κ_{est} are known, too. Furthermore, assume the convergence κ_{est} known for each l.o.s.

Consider a magnification estimate λ_{est}=λ_{est}(κ_{est}) that is based on the estimated convergence κ_{est}. Consider the (unknown) residual magnification

_{est}(κ

_{est}) obtained from its (known) convergence estimate κ

_{est}. The conditional bias , i.e. the mean residual for a fixed estimated convergence κ

_{est}, is then given by Moreover, the conditional distribution of the residual λ

_{res}for a given convergence estimate κ

_{est}is then simply a shifted version of the conditional PDF of the true magnification λ: This implies that the conditional variance of the residual equals the conditional variance of the true magnification for any magnification estimate λ

_{est}(κ

_{est}).

The problem of finding the optimal magnification estimate λ_{est}(κ_{est}) can be approached with basic calculus of variations. First, one has to define ‘optimal’, e.g. by demanding that an optimal estimate (i) is unbiased, i.e. , and (ii) minimizes the residual variance12