Theory of pixel lensing towards M31 I: the density contribution and mass of MACHOs

POINT-AGAPE is an Anglo-French collaboration which is employing the Isaac Newton Telescope (INT) to conduct a pixel-lensing survey towards M31. In this paper we investigate what we can learn from pixel-lensing observables about the MACHO mass and fractional contribution in M31 and the Galaxy for the case of spherically-symmetric near-isothermal haloes. We employ detailed pixel-lensing simulations which include many of the factors which affect the observables. For a maximum MACHO halo we predict an event rate in V of up to 100 per season for M31 and 40 per season for the Galaxy. However, the Einstein radius crossing time is generally not measurable and the observed full-width half-maximum duration provides only a weak tracer of lens mass. Nonetheless, we find that the near-far asymmetry in the spatial distribution of M31 MACHOs provides significant information on their mass and density contribution. We present a likelihood estimator for measuring the fractional contribution and mass of both M31 and Galaxy MACHOs which permits an unbiased determination to be made of MACHO parameters, even from data-sets strongly contaminated by variable stars. If M31 does not have a significant population of MACHOs in the mass range 0.001-1 Solar masses strong limits will result from the first season of INT observations. Simulations based on currently favoured density and mass values indicate that, after three seasons, the M31 MACHO parameters should be constrained to within a factor four uncertainty in halo fraction and an order of magnitude uncertainty in mass (90% confidence). Interesting constraints on Galaxy MACHOs may also be possible. For a campaign lasting ten years, comparable to the lifetime of current LMC surveys, reliable estimates of MACHO parameters in both galaxies should be possible. (Abridged)


INTRODUCTION 1.Conventional microlensing: landmarks and limitations
The detection of the gravitational microlensing effect due to compact objects in the Galaxy is undoubtedly one of the great success stories in astrophysics over the past decade.
c 0000 RAS 2 E. Kerins et al. Surveys have discovered around 20 candidates towards the Magellanic clouds and several hundred towards the Galactic Bulge (Udalski et al. 1994;Alard & Guibert 1997;Lasserre et al. 1999;Alcock et al. 2000). Amongst these candidates a number of exotic lensing phenomena have been catalogued, such as parallax effects, binary lensing (including spectacular examples of caustic-crossing events), and finite source-size effects. These discoveries are facilitated by coordinated follow-up campaigns such as PLANET (Albrow et al. 1998) and MPS (Rhie et al. 1999) which act on microlensing alerts broadcast by the survey teams. The absence of certain microlensing signals has also yielded a clearer insight into the nature of halo dark matter. The null detection of short duration events towards the Large Magellanic Cloud (LMC) by the EROS and MACHO surveys indicates that, for a range of plausible halo models, massive compact halo objects (MACHOs) within the mass interval 10 −7 −10 −3 M ⊙ provide less than a quarter of the dark matter (Alcock et al. 1998). This is an important result when set against the current insensitivity of other techniques to this mass range. Despite these successes a number of unsolved problems remain. The optical depth measured towards the Galactic Bulge is at least a factor two larger than can be accommodated by theoretical models (e.g. Bissantz et al. 1997;Sevenster et al. 1999). Towards the LMC the rate of detected events is consistent with the discovery of a significant fraction of the halo dark matter. However, the implied lens mass range (0.1 − 1 M ⊙ ) is not easily reconciled with existing constraints on baryonic dark matter candidates (Carr 1994), though the MACHOs need not necessarily be baryonic. Furthermore, the discovery of two possible binary caustic-crossing events towards the LMC and the Small Magellanic Cloud (SMC) has thrown into question the very existence of MACHOs. Their caustic-crossing timescales, which provide an indicator of their line-of-sight position, seem to exclude either as being of halo origin, a statistically unlikely occurrence if the halo comprises a significant MACHO component (Kerins & Evans 1999). As a result, there is a growing body of opinion that all events observed so far towards the LMC and SMC may reside in the clouds themselves. However, this explanation is itself problematic because it requires that the clouds must either have a higher MACHO fraction than the Galaxy or comprise substantial but diffuse stellar components not in hydrodynamical equilibrium (Evans & Kerins 2000, and references therein).
These problems highlight two principal constraints on the ability of conventional microlensing experiments to determine the nature and distribution of MACHOs in the halo. The first limitation is their inefficiency in differentiating between lensing by MACHOs and self-lensing by the source population, since for most events one observes only a duration and a position on the sky. These observables are only weakly correlated with the location of the events along the line of sight. The second constraint is the limited number of suitable lines of sight through the halo. Conventional microlensing surveys require rich yet resolved stellar fields and are thus limited to just two lines of sight, the LMC and SMC, with which to probe MACHOs. The line of sight to the Galactic Bulge is dominated by bulge and disc lensing. The paucity of halo lines of sight, together with the rather   weak dynamical and kinematical constraints on Galactic halo structure, also diminishes the prospect of being able to decouple information on the Galactic distribution function and MACHO mass function.

Beyond the Galaxy: a new target, a new technique
The possibility of detecting MACHOs in an external galaxy, specifically M31, was initially explored by Crotts (1992) and by Baillon et al. (1993). Crotts (1992) pointed out that the high inclination of the disc of M31 would result in an asymmetry in the observed rate of microlensing if the disc is surrounded by a MACHO halo, as illustrated in Figure 1. The fact that the M31 MACHO microlensing rate should be lower towards the near side of the disc than the far side, which lies behind a larger halo column density, means that the presence of MACHOs in M31 can be established unambiguously. In particular, neither variable stars nor stellar self-lensing events in the disc of M31 should exhibit near-far asymmetry. Additionally, the external vantage point serves to reduce systematic model uncertainties in two ways. Firstly, it permits a more accurate determination of the rotation curve and surface brightness profile than is possible for the Galaxy, which reduces the prior parameter space of viable galactic models. Secondly, it provides many independent lines of sight through the halo of M31, allowing the MACHO distribution across the face of the disc to be mapped and thus the halo distribution function to be constrained more or less directly. As pointed out by Baillon et al. (1993), another appeal of directing observations towards more distant large galaxies like M31 is the increase in the number of potential source stars, more than a factor of one thousand over the number available in the LMC and SMC, and all confined to within a few square degrees. However, this also presents a fundamental problem in that the source stars are resolved only whilst they are lensed (and even then only if the magnification is sufficiently large). The presence of many stars per detector pixel means it is often impossible to identify which is being Theory of pixel lensing towards M31 I 3 lensed. Furthermore, the flux contribution of the unlensed stars dilutes the observed flux variation due to microlensing. Nonetheless, Baillon et al. (1993) determined from numerical simulations that the number of observable events, due to either the lensing of bright stars or high magnification events, is expected to be large. As a result of these studies, the Andromeda Galaxy Amplified Pixel Experiment (AGAPE) and another group, Columbia-VATT, commenced observing programs towards M31 (Ansari et al. 1997;Crotts & Tomaney 1997).
One of the biggest technical difficulties facing surveys which look for variable sources against unresolved stellar fields is how to distinguish between flux variations due to changing observing conditions and intrinsic variations due to microlensing or stellar variability. For example, changes in seeing induce variations in the detected flux within a pixel. One must also deal with the consequences of positional misalignment between exposures, spatial and temporal variations in the point spread function (PSF) and photometric variations due to atmospheric transparency and variable sky background.
AGAPE has employed the Pixel Method to cope with the changing observing conditions (Ansari et al. 1997). AGAPE thoroughly tested this technique with a three-year campaign using the 2m Bernard Lyot telescope at Pic du Midi from 1994 to 1996 (Ansari et al. 1997;Ansari et al. 1999;Le Du 2000). Six fields covering about 100 arcmin 2 centred on the bulge of M31 were monitored. Whilst the field of view was insufficient to conclude much about the nature of MACHOs, 19 candidate events were detected, though it is still premature to rule out many of them being intrinsically variable sources, such as Miras or novae. One event, AGAPE Z1, appears to be a convincing lensing candidate as its flux increase and colour are inconsistent with that of a Mira or nova (Ansari et al. 1999). A longer baseline is needed to determine how many of the other candidates are due to microlensing.
A major observing programme began on the 2.5m Isaac Newton Telescope (INT) in La Palma in the Autumn of 1999, with a run of one hour per night for almost sixty nights over six months. The POINT-AGAPE collaboration is a joint venture between UK-based astronomers and AGAPE (where POINT is an acronym for "Pixel-lensing Observations with INT"). We are exploiting the 0.3 deg 2 field of view of the INT Wide-field Camera (WFC) to map the distribution of microlensing events across a large region of the M31 disc. Our initial observations of M31 with the INT employed a V filter and the simulations reported here have been undertaken with parameters appropriate to V-band observations. The strategy employed for the actual M31 monitoring campaign involves observations in three bands, g, r, and i [very similar to the bands employed by SLOAN (Fukugita et al. 1996)]. The multi-colour observations will improve our ability to discriminate against variable stars and the gri-filter plus CCD combination offers a significant improvement in sensitivity (the g-band zero-point is some 0.4 magnitudes fainter than that for V ). The simulation parameters are thus somewhat conservative in this regard. The programme is being conducted in consort with the Microlensing Exploration of the Galaxy and Andromeda (MEGA) survey (Crotts, Uglesich & Gyuk 1999), the successor program to Columbia-VATT. Whilst POINT-AGAPE and MEGA are sharing the data, different techniques are being employed to search for microlensing events. Henceforth we use the term pixel lensing (Gould 1996) to describe microlensing against unresolved stellar fields, regardless of the detection technique.
Whilst the technical viability of pixel lensing is now clearly established, a number of important theoretical issues are still outstanding. The principal concern is that the main observable in classical microlensing, the Einstein crossing time, is generally not accessible in pixel lensing. The Einstein crossing time is directly related to the lens mass, its transverse velocity and the observer-lens-source geometry. In pixel lensing the observed timescale depends upon additional factors, such as the local surface brightness and the source luminosity and magnification, so the dependence on lens parameters is much weaker than for classical microlensing.
The first detailed study of pixel lensing was undertaken by Gould (1996). He defined two regimes: a semi-classical regime in which the source star dominates the pixel flux and the observable timescale provides a fair tracer of the Einstein crossing time; and the "spike" regime where only highmagnification events are identified, and the timescales are only weakly correlated with the underlying Einstein crossing duration. Remarkably, Gould showed that, despite the loss of timescale information, in the spike regime one can still measure the microlensing optical depth. Using Gould's formalism, Han (1996) provided the first pixel event rate estimates for the M31 line of sight. However, Gould's formalism assumes a fixed sampling rate and unchanging observing conditions. As such it is of limited applicability to a groundbased observing program. Gondolo (1999) has proposed an optical depth estimator based on the observed pixel event timescale. Whilst this estimator can be readily employed by a ground-based campaign, it is somewhat sensitive to the shape of the source luminosity function and is valid only to the extent that this can be taken to be the same for all source components. More recently, Baltz & Silk (1999) derived expressions for the pixel rate and timescale distribution in terms of the observable timescale, rather than the Einstein crossing time. Again, their study assumes constant sampling and observing conditions, as would be the case for space-borne programmes.
Whilst these studies provide a solid foundation for predictions of pixel-lensing quantities (i.e. timescales, rates and optical depth), none of them address to what extent one can constrain galactic and lens parameters, in particular the MACHO mass, from pixel lens observables. Gyuk & Crotts (2000) have shown that a reliable measure of the optical depth from pixel lensing can be used to probe the core radius and flattening of the M31 MACHO halo.
In this paper we quantitatively assess the degree to which the POINT-AGAPE campaign directed towards M31 will constrain the fractional contribution and mass of the MACHOs. Since the answer inevitably depends upon the assumed galactic distribution function, we focus attention here on the simple case of spherically-symmetric near-isothermal halo models. The line of sight towards M31 is sensitive to two MACHO populations, our own and that in M31 itself, so we investigate the extent to which they can be distinguished and probed independently. We also model the ex-4 E. Kerins et al. pected background due to variable stars and lenses residing in the disc and bulge of M31.
The plan of the paper is as follows. In Section 2 we summarize the basic principles of pixel lensing, with emphasis on the differences between pixel lensing and classical microlensing. We describe our Monte-Carlo pixel-lensing simulations in Section 3, including our event selection criteria and the incorporation of realistic sampling and observing conditions. In Section 4 we construct a reference model for the lens and source populations in the halo of the Galaxy and the halo, disc and bulge of M31, seeking consistency with the observed M31 rotation curve and surface brightness profiles. In Section 5 we present predictions for the POINT-AGAPE survey based on our simulations. In Section 6 we use the simulations to generate artificial data-sets and we investigate to what extent the MACHO mass and fractional contribution in the two galaxies can be recovered from the data. The results are summarized and discussed in Section 7.

PRINCIPLES OF PIXEL LENSING
We review here some of the main aspects of pixel lensing and its differences with classical microlensing. A more detailed overview can be found in Gould (1996).

Detecting pixel events
Whilst in classical microlensing one monitors individual sources, in pixel lensing the sources are resolved only whilst they are lensed. We can therefore only monitor the flux in each detector element rather than the flux from individual sources. If a star is magnified sufficiently due to a lens passing close to its line of sight, then the total flux in the detector element containing the source star (due to the lensed star, other nearby unlensed stars and the sky background) will rise significantly above the noise level and be recorded as an event.
Before treating seeing variations the sequence of images must be geometrically and photometrically aligned with respect to some reference image, R, as described in Ansari et al. (1997). The variations remaining after alignment are primarily due to changes in seeing and source flux, including microlensing events. To minimize the effects of seeing we define our base detector element to be a superpixel: a square array of pixels. A superpixel is defined for each pixel, with that pixel lying at the centre, so that neighbouring superpixels overlap with an offset of one pixel. The optimal size for the superpixel array is set by the ratio of the size of the seeing disc on images obtained in poor seeing to the individual pixel size. The INT Wide-field Camera (WFC) has a pixel scale corresponding to 0. ′′ 33 on the sky, whilst poor seeing at La Palma is ∼ 2 ′′ . Adopting a very conservative value of 2. ′′ 4 for the worst seeing leads to an optimized choice of 7 × 7 pixels for the superpixel array. A larger array would overly dilute source variations, whilst a smaller array would be overly sensitive to changing observing conditions.
Whilst seeing variations are reduced by binning the photon count into superpixels, this by itself is not enough to make them negligible. Residual variations are minimized by the Pixel Method, in which a simple, empirically-derived statistical correction is applied to each image to match it to the characteristics of the reference image R. The Pixel Method is discussed in Ansari et al. (1997) and described in detail by Le Du (2000). The method strikes a good balance between computational efficiency and optimal signal-to-noise ratio, with the resulting noise level approaching the photon noise limit.
After alignment and seeing corrections the excess superpixel photon count ∆Npix on an image i obtained at epoch ti due to an ongoing microlensing event is Here Ns and N bl are the source and baseline photon counts in the absence of lensing, A is the source magnification factor due to lensing and fsee is the fraction of the seeing disc contained within the superpixel. The baseline photon count, N bl = N gal (R) + N sky (R), is the sum of the local M31 surface brightness (including Ns) and sky background contributions on the reference image. Whilst the quantities N bl and fseeNs(A − 1) can be determined independently, Ns and A cannot in general be inferred separately. It is therefore convenient to define Apix as the superpixel count variation factor, which acts as the observable analogue of A. The superpixel noise on image i is where refers to the superpixel photon count on image i prior to correction and, similarly, N sky and N gal are the uncorrected sky background and galaxy surface brightness contributions. The threshold noise level σT is determined by the superpixel flux stability, and the scaling factor αi takes account of the fact that the Pixel Method is not photon-noise limited. A preliminary analysis of a sequence of INT WFC images taken in 1998 demonstrated a flux stability level of 0.1 − 0.3% (Melchior 1999). We therefore adopt a conservative minimum noise level of σT = 2.5 × 10 −3 N bl for our simulations. We also apply a constant scaling factor αi = 1.2, which is a little larger than typical for the AGAPE Pic du Midi data (Le Du 2000). In reality αi varies slightly between images though we neglect this variation in our simulations. Note that N gal in equation (3) is constant, despite the changing observing conditions. Though some variable fraction of the local patch of surface brightness is dispersed over neighbouring superpixels, the same amount of surface brightness leaks into the superpixel from neighbouring patches, so there is no net variation. The variation in N sky results from changing moonlight and atmospheric transparency.
We regard a signal as being statistically significant if it occurs at a level 3 σi above the baseline count N bl . Our estimate of N bl must be obtained from a sequence of images and operationally is defined to be the minimum of a sliding average of superpixel photon counts over ten consecutive epochs. In order for a signal to be detected on image i we therefore require a superpixel count variation factor Apix(ti) ≥ 1 + 3 σi/N bl . From equation (1), a microlensed source satisfies this inequality provided that it is magnified by a factor exceeding A special case of equation (4) occurs when σi = σT, giving a threshold magnification of AT = 1 + 0.0075 N bl fseeNs .
The extent to which residual temporal variations in fsee and N bl remain after image processing determines the factor by which σi exceeds the photon noise limit, so this excess noise is explicitly accounted for in equation (4). Equation (4) illustrates some important characteristics of pixel lensing. Firstly, pixel lensing does not depend directly on the local surface brightness or sky background, but it does depend on their contribution to the noise σi. Secondly, if the exposure time Texp is short, or the source star constitutes only a small fraction of the superpixel flux, so that Ns ≪ σi, only rare high-magnification events are detected. The relationship between lens magnification and lens-source impact distance (measured in the lens plane) is as for the classical case: where u is the impact distance in units of the Einstein radius. The maximum value for the impact distance can be obtained by inverting equation (6) for A = Amin: For pixel lensing in M31 we are often in the regime where Ns ≪ σi because the source flux is much less than that of the galaxy and background, so it is not unusual to require Amin > ∼ 10. In this case equations (4) and (7) imply Since umax ≪ 1 [typically umax ∼ O(10 −2 − 10 −3 )] only a small fraction of classical (u ≤ 1) microlensing events are detectable.
The dependence of umax on Ns means that the pixel event rate depends on the source luminosity function φ(M ), the number density of sources in the absolute magnitude interval (M, M + dM ). We can compute a theoretical upper limit, Γp, for the pixel-lensing rate at sky coordinate (x, y) by taking Amin = AT so that umax = u(AT) = uT. In this case where x and y are Cartesian coordinates centred on M31 and aligned respectively along the major and minor axes of the projected light profile. We define y to be positive towards the near side of the disc. The quantity Γc is the classical (u ≤ 1) event rate integrated over lens and source populations (Griest 1991;Kiraga & Paczyński 1994), and is the mean threshold impact parameter at (x, y) averaged over φ.
Whilst useful in providing a rough order of magnitude estimate, Γp cannot be compared directly with observations because it assumes perfect sensitivity to all event durations and it also assumes that observing conditions are unchanging. Since one usually has Amin > AT, equation (10) also tends to overestimate the true mean pixel-lensing crosssection. One can regard Γp, evaluated under the best observing conditions, as providing a strict theoretical upper limit to the observed event rate, in much the same way as Γc provides an upper limit to the observed rate in classical lensing. In Section 3 we set about obtaining a more realistic estimate of the observed pixel lensing rate.

Degenerate and non-degenerate regimes
In classical microlensing the most important observable is the Einstein radius crossing time, since this is directly related to the position, motion and mass of the lens. Can we obtain similar information from the duration of pixel events?
For a lens moving at constant velocity across the line of sight, u evolves with time t as in the classical case: where t0 is the epoch of minimum impact distance and te is the Einstein radius crossing time. From equations (6) and (11), te gives the timescale over which the source magnification A varies significantly. For large magnifications u ≃ A −1 from equation (7), and inserting equation (11) into equation (1) gives where Amax ≡ A(t0) is the maximum magnification. We infer that in pixel lensing the timescale over which the signal varies significantly is teA −1 max rather than te. This means that, in the high-magnification regime, the pixel-lensing timescale bears little relation to te. We also see that the light-curve is degenerate under transformations Amax → αAmax, Ns → Ns/α and te → αte (Wozniak & Paczyǹski 1997). So neither te, Amax nor Ns can be determined independently. It may sometimes be possible to break this degeneracy by looking at the wings of the light-curve (Baltz & Silk 1999), where differences between the true magnification and its degenerate form can become apparent. From equation (6), the difference between the exact expression for A(u) − 1 appearing in equation (1) and its degenerate approximation, u −1 , is To discriminate reliably (say at the 3 σ level) between the degenerate and non-degenerate cases requires fseeNs|∆(A − 1)| > 3 σi, so for the high-magnification regime we can write the condition for non-degeneracy as Equation (14) demands that the superpixel noise be no greater than the contribution of the unlensed source to the superpixel flux. In general this will not be the case, so observations will not be able to break the light-curve degeneracy and thus will not directly probe the Einstein crossing time.
Since the underlying duration te is not generally measurable we use the observed full-width half-maximum (FWHM) event duration: where a = Amax − 1. Since Amax for detected events is typically larger in regions of higher surface brightness, and for fainter stars, tFWHM is correlated both with the disc surface brightness and the source luminosity function. This means that it is less strongly correlated than te with the lens mass and velocity and the lens and source distances. The observed duration, tFWHM, does not afford us with as direct a probe of lens parameters as te. We are therefore forced to rely on other observables, such as spatial distribution, in order to probe the underlying MACHO properties. For M31 MACHOs one can test for near-far asymmetry in the event rate (Crotts 1992). For Galaxy MACHOs there is no comparable signature. Looking from the centre of the Galaxy towards M31 the halo density distribution in the two galaxies is highly symmetric about the observer-source midpoint. Since the microlensing geometry is also symmetric about the midpoint the timescale distributions for Galaxy and M31 MACHOs are similar for the same mass function. Since our displacement from the Galactic centre is only 8 kpc (small compared to the scale of the haloes and the Galaxy-M31 separation) this geometrical symmetry is largely preserved at our location. However, the Galaxy MACHO distribution ought to be less concentrated than that of stellar lenses. One might hope to see this as an excess of events at faint isophotes which remains the same towards both the near and far disc. If MACHOs exist, the overall pixel-lens distribution will be superposition of several lens populations (Galaxy halo, M31 halo, disc and bulge) together with variable stars which, at least in the short term, appear indistinguishable from microlensing. The task of disentangling each is therefore potentially tricky.

SIMULATING PIXEL EVENTS
A straightforward method for probing the lens populations is to construct simulations of the expected distribution of events for a particular telescope configuration, set of observing conditions and selection criteria and then compare these predictions to observations. To this end we have constructed a detailed simulation of a realistic pixel-lensing experiment.
Our simulation works by first computing a theoretical upper limit to the pixel rate for assumed M31 and Galaxy models. This estimate provides the basis for generating trial pixel microlensing events for which light-curves are constructed and selection criteria applied. The precise details of our input galaxy models are discussed in Section 4; in this section we lay down the general framework for the simulation. For each generated trial event, a pixel light-curve is constructed using a realistic distribution of observing epochs interrupted by poor weather and scheduling constraints. The effects of the sky background and seeing are explicitly taken into account in computing flux realizations and errors for each "observation". The observing sequence is then examined to see whether the event passes the detection criteria -if it does, then the trial counts as a detected event. The simulation is terminated once 10 4 events are detected or 10 6 trials generated, whichever is reached first. The fraction of trial events which are detected is used to compute the observed pixel rate. The statistical error on the rate determination is typically about 3%.

Generating trial events
As the starting point for our simulation we use the theoretical pixel event rate as a function of position, Γp(x, y), defined by equation (9). This quantity, evaluated for the best seeing conditions, always provides an upper limit to the detection rate at a given location and is therefore convenient to use to generate trial events. We compute Γp,j over a grid of locations (x, y) for each combination j of lens and source population. Near the centre of M31, j = 1 . . . 8 since there are two source populations (M31 disc and bulge) and four lens populations (Galaxy halo, M31 halo, M31 disc and M31 bulge). Beyond 8 kpc the M31 bulge is not in evidence, so j = 1 . . . 3.
Given the grid of Γp,j(x, y), one can write the probability of observing an event at location (x, y) as where Sj is the source surface density at (x, y) for lenssource configuration j, and ∆x and ∆y are the local x and y grid spacings (required only for non-uniform grids). P (x, y) therefore reflects the total event rate in a box of area ∆x∆y centred on (x, y). The box should be sufficiently small that Sj(x, y) and Γp,j(x, y) provide good estimates of the source density and theoretical rate anywhere within it. Having fixed the event location, Γp,j is then used to select the lens and source components from the probability distribution P (j) = Sj(x, y)Γp,j(x, y) j Sj (x, y)Γp,j(x, y) .
Once the event location and lens and source populations have been decided, the next choice is the line-of-sight distances to the lens, D l , and source, Ds: where ρ l and ρs are respectively the lens and source mass densities. These distributions reflect the dependency of the microlensing rate Γp,j on Ds, integrated over all possible D l , and on D l , for a given Ds. Next we require the lens mass m and relative transverse speed Vt. The lens mass realization is generated from the distribution since, in the absence of finite source-size effects, Γp ∝ Reψ ∝ m 1/2 ψ, where ψ is the lens mass function (i.e. the number density of lenses per unit mass interval) and Re is the Einstein radius. The transverse speed Vt(Vl, Vs) is drawn from the assumed velocity distributions P l (Vl) and Ps(Vs) (see section 4), with Vl and Vs the lens and source threedimensional velocity vectors. Since the microlensing rate Γp is proportional to VtP l Ps rather than just P l Ps, each of our realizations must be weighted by Vt in computing the final detection rate. Finally, we also need to generate the source Theory of pixel lensing towards M31 I 7 absolute magnitude M (defined for some photometric band). The dependency of Γp on M derives from the luminosity function φ and the threshold impact parameter uT, so we have

Generating light-curves
At this point we have only simulated events according to the underlying distributions which govern Γp; we have yet to take into account the distribution of observing epochs, variations in observing conditions, or candidate selection criteria.
The observing season runs from the beginning of August to the end of January, so we adopt the duration of an observing season to be ∆T = 180 days. We assume 60 scheduled observing epochs per season -approximately the number of nights awarded for our 1999/2000 season. To construct a realistic sequence of observing epochs we assume that the WFC is mounted on the telescope and available for two-week periods every four weeks and that, on average, 25% of scheduled observations are precluded by bad weather. Periods of poor weather are superposed on our initial observing sequence to obtain a final sequence which typically comprises 40-50 epochs per season. In practice we expect to obtain observations on more epochs than this, but for the purposes of these simulations we assume 40-50 as a conservative lower limit. For example during the 1999/2000 season we have had observations on 56 nights.
The epoch of maximum magnification t0 and the minimum impact parameter u(t0) are both chosen at random. u(t0) is selected from the interval [0, uT], where the threshold impact parameter uT is computed from equations (5) and (7) taking Amin = AT. This is all that is required to generate the underlying microlensing light-curve.
To compute the pixel light-curve, we must also model the galaxy surface brightness and sky background. The simulations presented here are performed in the V band and we use the radially-averaged surface brightness profile in Table VI of Walterbos & Kennicutt (1987) to estimate the contribution to the pixel flux of the galaxy background at the event location. The assumed sky background corresponding to a dark sky is listed in Table 1, along with other INT detector and site characteristics. The sky background varies over lunar phase and we adopt a contribution to the sky background from the full moon equivalent to 10 3 tenth magnitude stars per deg 2 (c.f. Krisciunas & Schaefer 1991). The contribution is modulated according to the lunar phase. The lunar contribution to the sky background also depends upon whether the moon is above the horizon and on its angular distance from M31. Our assumed value is taken to be an average over the positional dependence, so the true variation in the sky background will be somewhat larger than we consider. We also simplify the computation of the seeing fraction fsee by adopting a Gaussian PSF with a FWHM equal to the seeing of the reference image. The position of the PSF maximum for the reference image is selected at random within the central pixel of the superpixel array.
Using our computed values for fsee, the INT detector and site characteristics summarized in Table 1, and the microlensing parameters generated for each event, we construct Table 1. Adopted characteristics of the INT observing site and Wide-field Camera (WFC). The sky background is given in mag arcsec −2 and the superpixel dimension is quoted in pixels. The zero-point is given in terms of the apparent magnitude of a source which results in a 1 photon sec −1 detection rate. All magnitudes are for the V band. Our survey is now observing in g, r and i filters. For comparison, the sky background and zero-point in g are 22.2 and 26.0, respectively.  (1). The error at each epoch i is given by equation (2). Poisson realizations for the superpixel flux at each epoch are generated from Npix(ti) and σi.

Selection criteria and the observed rate
The adoption of selection criteria inevitably reduces the number of detected events, but they are necessary to minimize the number of contaminating non-microlensing signals. As in all microlensing experiments the selection criteria must be based upon the quality of the data and the characteristics of non-microlensing variations. Ultimately the criteria must be derived from the data themselves, so they are inevitably experiment-specific and evolve as the experiment progresses. For our simulations we impose criteria based loosely on the previous AGAPE pixel-lensing at Pic du Midi (Ansari et al. 1997;Le Du 2000). The principal criterion for the selection of microlensing events in our simulation is that one and only one significant bump be identified on the light-curve. The bump must comprise at least three consecutive measurements lying at least 3σ above the baseline superpixel flux. Quantitatively, the significance of a bump is defined by its likelihood where Θi = [Npix(ti) − N bl ]/σi and P (Θ) is the probability of observing a deviation at least as large as Θ by chance. For a Gaussian error distribution, P = 1 2 erfc(Θ/ √ 2). Equation (21) indicates that we evaluate P (Θi) only when Θi ≥ 3. For our simulations we demand that a candidate have one bump with − ln L bump > 100 and no other bump with − ln L bump > 20. We further demand that the epoch of maximum magnification t0 lies within an observing season; we reject candidates which attain their maximum brightness between seasons, even if they last long enough for the tails of the light-curve to be evident. This helps to ensure a reliable estimate of the peak flux, and in turn the FWHM timescale tFWHM. Table 2. Parameters adopted for the density and velocity distributions for components of the Galaxy and M31. The bulge model is adopted from Kent (1989). The bump criterion is both a signal-to-noise ratio condition and a test for non-periodicity. It is crucial for distinguishing microlensing events from periodic variables, though long-period variables, such as Miras, may pass this test in the short term. In addition to the bump test, one can also test the goodness of fit of the light-curve to microlensing, which helps to distinguish microlensing from typical novae light-curves. Though the presence of the background means that pixel events will not in general be achromatic, the ratio of the flux increase to baseline flux in different colours should nonetheless be independent of time, so this provides another test for microlensing. Colour information may also help to exclude some long-period variables in the absence of a sufficient baseline of observations. In Section 6 we also exploit differences in spatial distribution to separate statistically lensing events from variable stars.

Rotation
For real data-sets we would require more criteria in order to avoid excessive contamination from variable stars. For now we are simulating only microlensing events, so we are assured of no contamination in our selection. However, the cuts adopted above would be responsible for many of the rejected candidates in a real experiment, so the absence of further criteria should not lead to a gross overestimate of the rate. In any case, we have been deliberately conservative with our choices of sky background level, worst seeing scale, the number of epochs per season and the pixel stability level σT. We therefore feel our predictions are more likely to be underestimates of the actual detection rate.
The observed rate can be now readily computed from Γp, the number of generated trials and the fraction of these which pass the detection criteria. As mentioned in Section 3.1, the way in which velocities are generated in the simulations means that the correct rate is obtained by weighting each event by its transverse speed Vt. Thus, the observed rate for lens component j is where Γp,j x,y is the spatial average of Γp,j (summed over source populations), the lower summation is over all N trial trial events generated for lens component j and the upper summation is over the N det detected events which pass the selection criteria. The total number of events after n observing seasons is where M is the average absolute magnitude of the sources (integrated over the luminosity function) and M gal is the absolute magnitude of M31 (MV = −21.2).

Simulated light-curves
Three light-curves generated for a first-season simulation involving 0.1 M ⊙ MACHOs are shown in Figure 2. The galactic models required for the simulation are discussed in Section 4. The light-curves illustrate the range in signal-to-noise ratio. The down-time for the WFC is evidenced by the way in which the epochs are clumped into two-week periods. The variation in the size of the error bars reflects the simulated variation in observing conditions. Figure 2a shows an M31 halo lens magnifying a bulge star (MV = −0.4) and is a typical example. The underlying maximum magnification for this event is Amax = 18, whilst the maximum enhancement in superpixel flux is Apix(t0) = 1.06, indicating that the unlensed source is contributing less than 0.4% of the superpixel flux. For this event tFWHM = 5 days and te = 28 days. Figure 2b, which illustrates a poor candidate with a low signal-to-noise ratio, involves a Galaxy MACHO and MV = 1.8 bulge source contributing only 0.1% of the superpixel flux (Amax = 42, Apix(t0) = 1.05). In this example tFWHM = 5 days and te = 68 days. Though there appears to be evidence of a second bump after the main peak these points are all within 3 σ of the baseline and so do not count as a bump. Figure 2c shows a high signal-to-noise ratio "gold-plated" event in which a very luminous (MV = −4) disc source is lensed by an M31 MACHO (Amax = 5, Apix(t0) = 2.1) with an observed duration tFWHM = 19 days and underlying timescale te = 33 days. Here the bright unlensed source accounts for 27% of the superpixel flux.

LENS AND SOURCE MODELS
In order to make quantitative estimates for pixel-lensing observables, we must specify models for the principal Galaxy and M31 lens and source components. For M31 the main populations are the bulge, the disc and the dark MACHO halo. For the Galaxy only the MACHO halo is important since the disc does not contribute significantly. Our complete model therefore consists of these four populations. Two populations, the M31 disc and bulge, also provide the sources, so in total we have eight different lens-source configurations. For each population we must specify distributions for the  Table VI of Walterbos & Kennicutt (1987). (b) The overall rotation curve (solid line) for the same M31 model summed over bulge (dashed line), disc (dot-dashed line) and halo (dotted line) contributions. The crosses are from Figure 2 of Kent (1989) and are based on emission line measurements. For conversion to distance 1 kpc = 4.5 arcmin. density and velocity. Additionally, we must specify the lens mass and a luminosity function for the source populations. Throughout we assume a disc inclination of 77 • and a distance to M31 of 770 kpc, consistent with recent determinations (e.g. Stanek & Garnavich 1998).
Whilst the present paper is concerned only with quantities relating to M31 and Galaxy MACHOs, we must nonetheless include other significant lens components in our modeling in order to properly characterize the complexity of extracting physical information from observations. For the observations, unlike the simulations, we do not know in which population a particular lens resides.
The haloes are modeled as simple near-isothermal spheres with cores, having density profiles where ρ h (0) is the central density, a is the core radius, Rmax is the cutoff radius and r is the radial distance measured from the centre of either M31 or the Galaxy. The assumed values for ρ h (0), a and Rmax are given in Table 2. The halo fraction determinations in Section 6 are made with respect to these density normalizations. In our model the M31 halo has about twice the mass of the Galactic halo, though this mass ratio is controversial and has been challenged recently by Evans & Wilkinson (2000) who have studied the kinematics of several satellite galaxies around M31. The M31 disc is modeled by the sech-square law: where σ is the radial distance measured in the disc plane and z is the height above the plane. The normalization ρ d (0), scale-height H and scale-length h are given in Table 2. The bulge distribution is based on the work of Kent (1989). Kent models the bulge as a set of concentric oblatespheroidal shells with axis ratios which vary as a function of semi-major axis. We use the tabulated spatial luminosity density values in Table 1 of Kent (1989) and normalize the bulge mass under the assumption that the light traces the mass (constant bulge mass-to-light ratio). The mass normalization M b is listed in Table 2. The assumption of axisymmetry may be over-simplistic since the misalignment between the disc and bulge position angles probably implies a triaxial structure for the bulge. However, we are only indirectly concerned with bulge lensing in so much as it contaminates halo lensing statistics, so deviations from axisymmetry are not crucial.
The rotation curve and surface brightness profile for the adopted M31 components are shown in Figure 3. In constructing the surface brightness profile, we have assumed B-band mass-to-light ratios M/LB = 4 for the disc and M/LB = 9 for the bulge, consistent with that expected for typical disc and bulge populations. The overall surface brightness profile is shown by the solid line in Figure 3a, with the disc and bulge contributions indicated by the dashed and dot-dashed lines, respectively. The crosses are the radially c 0000 RAS, MNRAS 000, 000-000 Theory of pixel lensing towards M31 I 11 averaged measurements from Table VI of Walterbos & Kennicutt (1987). In Figure 3b the solid, dashed and dot-dashed lines show the overall, disc and bulge contributions to the rotation curve, with the dotted line giving the halo contribution. The crosses are from Figure 2 of Kent (1989) and are based on the emission-line curves of Brinks & Shane (1984) and Roberts, Whitehurst & Cram (1978). The fit to both the surface brightness and rotation profiles is good, given the simplicity of the models.
The lens and source velocities are described by rotational and random components. The rotation velocity for each component is given in the 4th column of Table 2. The random motions are modeled by an isotropic Gaussian distribution with a one-dimensional velocity dispersion given by the 5th column. When calculating the relative transverse lens speed Vt, we take account of both the motion of the source and the observer. The observer is assumed to move in a circular orbit about the centre of the Galaxy with a speed of 220 km s −1 . We do not assume any relative transverse bulk motion between the Galaxy and M31. In practice, only the observer's motion is of consequence for Galaxy lenses, and only the source motion for M31 lenses.
Since one of the questions we wish to address is how well pixel-lensing observables can characterize the MACHO mass, we shall simply model the Galaxy and M31 MACHO mass distributions by a Dirac δ-function: The stellar lens mass distribution in the disc and bulge is described by a broken power law: The mass function is normalized to yield the same value for ψ(0.5 M ⊙ ) for either slope. We take a lower mass cut-off m l = 0.08 M ⊙ and an upper cut-off mu = 10 M ⊙ , corresponding closely to the local Solar neighbourhood mass function (Gould, Bahcall & Flynn 1997). Whilst this is a reasonable assumption for stars in the M31 disc, the mass function will overestimate the contribution of massive stars in the older bulge. The higher M/LB assumed for the bulge also requires that the disc and bulge mass functions be different. However, the slope at high masses is steep, so the contribution of high mass stars to the lensing rate is in any case small. Furthermore, as already mentioned, we are only interested in the bulge population as a contaminant of the halo lensing statistics. The choice of upper mass cut-off for the bulge is therefore not critical for the present study, so we simply adopt the same mass function for the disc and bulge. The stellar components provide both lenses and sources. We assume that the lens and source populations are the same and so described by the same density, velocity and mass distributions. For the disc and bulge sources, we use the V -band luminosity function of Wielen, Jahreiss & Krüger (1983) for stars with MV > 5 and that of Bahcall & Soneira (1980) for MV ≤ 5. The two functions are normalized to the same value at MV = 5. A more detailed study of the M31 luminosity function is underway (Lastennet et al. 2000).

PREDICTIONS AND TRENDS FOR PIXEL LENSING
The simulations for the POINT-AGAPE survey are performed over 1, 3 and 10 observing seasons for 9 MACHO masses spanning the range 10 −3 − 10 M ⊙ . Each simulation produces an estimate of the number of events across the whole M31 disc for each lens component, together with a library of typically 10 4 candidates containing information such as the lens position, duration and transverse velocity.
Since te cannot generally be measured from the light-curve, we output both te and tFWHM. The event libraries can be filtered to provide an estimate of the pixel-lensing rate for any field placement.

Number of events
Whilst the factor 10 3 gain over LMC/SMC searches in the number of sources certainly boosts the rate of events, the fact that M31 pixel-lensing searches can typically detect only high-magnification events means that the gain in the rate is not of the same order. Nonetheless, as Figure 4 indicates, the expected pixel-lensing rate is almost an order of magnitude larger than for current LMC/SMC experiments for same lens mass and halo fraction. In the figure we have plotted the expected number of events for M31 MACHOs (solid line) and Galaxy MACHOs (dashed line) per season per deg 2 , assuming MACHOs comprise all the halo dark matter of both galaxies. The rates are averages over the whole M31 disc (rather than for a specific field placement) determined from simulations spanning ten seasons and 460 observing epochs. Within the first season the sensitivity to very massive MACHOs will be a little less than indicated in Figure 4. The rate of events occurring within the two INT WFC fields for their first season (1999/2000) positions are displayed in Table 3. This excludes events occurring within 5 arcmin of the centre of M31 because this region is dominated by stellar self-lensing (see Section 5.3). Only a couple of self-lensing events per season are expected outside the ex-   Table 3 is small, only about 3%, but one should expect a larger variation when comparing different seasons with different numbers of epochs (in addition to Poisson variations). From Figure 4 and Table 3 we see that the sensitivity to MACHOs peaks at a mass around 0.003−0.01 M ⊙ , when around 140 MACHO events can be expected within the INT WFC fields for full haloes. Below 10 −3 M ⊙ finite-source size effects become important, so the expected number of events will drop off rapidly. At the high mass end, even haloes comprising MACHOs as massive as 10 M ⊙ provide a rate of several events per season. The number of M31 MACHOs is about twice as large as the number of Galaxy MACHOs for the same mass and fractional contribution, which is a direct consequence of the mass ratio of the halo models we adopt.

Timescale distributions
In Figure 5 we plot the timescale distributions for the detected MACHOs for a range of masses in terms of tFWHM. The distributions for nine MACHO masses, spanning four orders of magnitude, are plotted. The masses are as listed in Table 3, with darker lines corresponding to more massive MACHOs. Since the timescale distributions for Galaxy and M31 MACHOs are practically indistinguishable for a given mass, in Figure 5 we have combined their timescale distributions, so the normalization of each curve is determined by the combined pixel-lensing rate shown in Figure 4 for each halo.
Whilst there is a clear trend of increasing tFWHM with increasing MACHO mass, the correlation is much weaker than for te. For example, a duration tFWHM = 10 − 20 days is typical of a 0.1 M ⊙ lens, but it is also not unusual for a lens as light as 10 −3 M ⊙ or as heavy as 10 M ⊙ . Figure 6 shows how the average duration tFWHM varies with mass separately for M31 (solid line) and Galaxy (dashed line) MACHOs. Over four orders of magnitude in mass tFWHM   also Table 4). For our sampling strategy we find empirically that tFWHM ∝ m 1/4 h , whereas the average Einstein radius crossing timescale for the underlying population of microlensing events (with u ≤ 1) scales as te pop ∝ m 1/2 h . The mean ratio tFWHM/te is displayed in Figure 7 for detected events. It is clear that the ratio is not fixed but steadily decreases with MACHO mass. For low MACHO masses with short durations, sampling imposes a lower limit on tFWHM and a loose lower limit on te as well. Whilst most events involving ∼ 10 −3 M ⊙ lenses are too short to be detected, those that are either have an unusually long te or occur in regions of low surface brightness (which maximizes tFWHM for a given magnification). Thus tFWHM/te is typically larger for the observed events. At the other end of the mass scale the converse is true. The total observation baseline imposes a maximum cutoff in tFWHM and a loose upper limit in te. Those events which are detected either have an unusually short te or else tend to occur in regions of high surface brightness where tFWHM is minimized for a given magnification. So tFWHM/te tends to be smaller for observed events. From Table 4 we see that the average duration of detected events te det does not trace the population average te pop. This is a consequence of sampling bias.

Spatial distributions
Since event timescales give only limited information in pixel lensing, the location of each event on the sky is a crucial observable. A robust measurement of near-far asymmetry in the event distribution would indicate the existence of an extended spheroidal population of lenses within which the visible M31 disc and bulge are embedded. Thus it would represent very firm evidence for the existence of MACHOs.
In Figure 8 we In Figure 8a the positions of all detectable events are shown. MACHOs from the Galaxy halo are shown in green whilst M31 MACHOs are shown in blue. We find that within the central 5 arcmins (denoted by the circle) most events are produced by ordinary stellar lenses in the disc and bulge (shown in red). In Section 6, where we try to estimate MACHO parameters from simulated data-sets, we disregard events occurring within this region so as to minimize contamination from stellar lenses. Figure 8b shows only the M31 MACHO distribution. The excess of events between y = −10 and −20 arcmins (along the minor axis towards the far side of the disc) compared to the number between y = +10 and +20 arcmins is a consequence of near-far asymmetry in the pixel-lensing rate. The strength of this asymmetry depends upon the number of M31 MACHOs which, in turn, depends upon their mass and density contribution, as well as the span of the observation baseline. The presence of Galaxy MACHOs makes the asymmetry harder to detect, so the ratio of M31 to Galaxy MACHOs is another factor which determines whether or not the asymmetry is measurable. It is evident from the figure that there are very few events at |y| > ∼ 25 arcmin. This is due to the decrease in both the number of sources and the signal-to-noise ratio (because the sky background provides a larger fraction of the total superpixel flux). The presence of the sky background effectively imposes a cut-off in the spatial distribution. Figure 9 shows the spatial distribution for a range of MACHO masses expected after three seasons. We again assume that the MACHO mass is the same in both galaxies and that MACHOs provide all the dark matter in the two haloes. Figure 9a is for a MACHO mass of 0.1 M ⊙ . In Figures 9b and 9c the MACHO mass is 1 M ⊙ and 10 M ⊙ respectively. The most obvious trend in the MACHO distributions is the decrease in the number of detectable events for models with more massive MACHOs. However, even for a mass as large as 10 M ⊙ we still expect to detect 30 − 40 MACHOs within the INT fields if they make up all the dark matter. After three seasons even these massive MACHOs out-number the disc and bulge lenses lying outside of our exclusion zone. This highlights one of the benefits of pixel lensing: the reduction in tFWHM due to the presence of many neighbouring unresolved sources means that more events with relatively large te can be detected and characterized within a given observing period. In this respect, pixel lensing is relatively more sensitive to massive MACHOs than conventional microlensing experiments, which require resolved sources.
Another noticeable trend in Figure 9 is that more massive MACHOs are concentrated towards the central regions of the M31 disc. The main reason is that the MACHO and source surface densities are largest in this region, so the probability of an event occurring there is larger. However, another factor is that it is in the regions of highest surface brightness that the ratio tFWHM/te is minimized for a given magnification. For the 10 M ⊙ MACHO model, where many events may have a duration te exceeding the survey lifetime, this means more light-curves can be fully characterized, enabling these events to be flagged as microlensing candidates within the observing period. The converse is true for lowmass MACHOs with short te. Their distribution is biased towards regions of lower surface brightness where tFWHM/te is maximized. This effect provides a further degree of discrimination for different lens masses and means that, for example, a halo with a modest contribution of low mass MACHOs may be distinguished from one with a substantial fraction of more massive lenses, even if the number of events for the two models is comparable. This in part makes up for the fact that tFWHM is a less powerful discriminant than te.

ESTIMATING MACHO PARAMETERS
In the previous section we found that, whilst the timescale information in pixel-lensing studies is somewhat more restricted than in conventional microlensing we do, at least for M31, have important information from the spatial distribution of lenses. We now address to what extent pixel-lensing observables permit a reconstruction of the MACHO mass and halo fraction in the Galaxy and M31. Alcock et al. (1996) presented a Bayesian maximum likelihood technique to estimate the Galaxy MACHO mass and halo fraction from the observed event timescales towards the LMC. Evans & Kerins (2000) extended this to exploit the spatial distribution of observed events, and also to allow for more than one significant lens population. For pixel lensing towards M31 we must also consider the effect of contamination by variable stars. This is likely to be a significant problem in the short term. A baseline of more than three years should be sufficient to exclude periodic variables, such as Miras, but there still remains the possibility that, occasionally, the signal-to-noise ratio may be insufficient to distinguish between novae and microlensing events. By taking account of variable stars in our likelihood estimator we allow ourselves to make an estimate of the MACHO mass and lens fraction which, even in the short term, is robust and unbiased.

Maximum-likelihood estimation
In order to allow for different MACHO parameters in the two galaxies we propose an estimator which is sensitive to five parameters: the MACHO mass and halo fraction in both the Galaxy and M31, and the degree of contamination by variable stars. We define our model likelihood L by ln L(fvar, fj , ψj ) = − fvarNvar + nc j=1 fj N (ψj ) where fvar is the fraction of variable stars relative to some fiducial model expectation number Nvar, fj and ψj are the lens fraction and mass function for component j, nc is the number of lens components and N obs the number of observed events. For the disc and bulge components fj and ψj are both fixed, with fj = 1 and ψj given by equation (27), whilst for the Galaxy and M31 haloes ψj ∝ m −1 j δ(m − mj), as in equation (26), and fj and mj are free parameters. We define fj with respect to the halo density normalizations in Table 2.
The resolution of our simulation is insufficient to evaluate reliably the third derivatives in equation (28), so we decouple the timescale and spatial distributions by computing (dN/dtFWHM)(d 2 N/dxdy) instead of d 3 N/dtFWHMdxdy within our fields. By averaging over spatial variations in the timescale distribution we are ignoring correlations which could provide us with further discriminatory information. However, in the limit of infinite data and perfect measurements we are still able to recover precisely the underlying parameters because the average event duration is known with infinite precision.
We assume that the distribution of variable stars traces the M31 surface brightness. In reality variable stars will be harder to detect in regions of higher surface brightness, so our idealized distribution is somewhat more concentrated than we should expect for a real experiment. We assume the timescale distribution of detectable variables is lognormal, with a mean and dispersion ln tFWHM = 2 and σ(ln tFWHM) = 0.5 (where tFWHM is expressed in days). Their timescales are therefore assumed to be typical of a wide range of lens masses (see Figure 5) and are thus least helpful as regards discrimination between lensing events and variable stars.
To test the likelihood estimator we generate dataset realizations and compute their likelihood over a fivedimensional grid of models spanning a range of MACHO masses and variable star and MACHO fractions. For the grid sampling we assume uniform priors in the variable star and MACHO fractions and logarithmic priors for the MACHO masses. Since the events in the inner 5 arcmin of the M31 disc are predominately due to stellar lenses (mostly bulge self-lensing) we count only events occurring outside of this region. Figure 10 shows the degree to which the MACHO parameters can be recovered after one season in the optimal case where the data-set contains no variable stars. For the realization we have adopted a MACHO fraction of 0.25 and mass of 0.5 M ⊙ for both the Galaxy and M31 haloes, and have set fvar = 0. The MACHO parameters correspond to those preferred by the most recent analyses of the EROS and MA-CHO teams (Lasserre et al. 1999;Alcock et al. 2000). Each panel in Figure 10 represents a two-dimensional projection of the five-dimensional likelihood, in which each point on the two-dimensional plane is a summation of likelihoods over the remaining three dimensions. Contours are constructed about the two-dimensional maximum likelihood solution which enclose a given fraction of the total likelihood over the plane. The contours shown enclose 34% (solid line), 68% (dashed line), 90% (dot-dashed line), 95% (dotted line) and 99% (triple dot-dashed line) of the total likelihood. The star in each plane shows the input values for the realization.

First-season expectations
The four panels in Figure 10 depict the likelihood planes for M31 MACHO fraction and mass (top left), Galaxy MA-CHO fraction and mass (top right), M31 and Galaxy MA-CHO fractions (bottom left) and M31 MACHO and variable star fractions (bottom right). From the top-left panel we see that, after just one season, useful constraints are already possible for M31 parameters. In this realization the 90% confidence level spans around two orders of magnitude in MA-CHO mass (∼ 0.05 − 10 M ⊙ ) and an order of magnitude in halo fraction (∼ 0.1−1.1). The brown-dwarf regime is mostly excluded. In the upper-right panel we see that the Galaxy MACHO parameters are ill-defined after one season. This is unsurprising since Galaxy MACHOs are out-numbered two to one by M31 MACHOs and they have no signature comparable to the near-far asymmetry of their M31 counterparts. The panel shows a suggestive spike in the likelihood contours occurring at about the right mass range, though the contours marginally prefer a Galaxy halo with no MACHO component. The one firm conclusion that can be drawn is that a substantial contribution of low-mass lenses is strongly disfavoured by the data. The strongest constraints occur at ∼ 0.003 M ⊙ , where the expected number of events peaks for a given fractional contribution. The likelihood estimator indicates that 0.003 M ⊙ lenses contribute no more than ∼ 5% of the Galactic dark matter with 90% confidence. In the lower-left and lower-right panels of Figure 10 we see the trade-off between M31 and Galaxy MACHO fractions and between M31 MACHO and variable star fractions, respectively. The lower-left panel indicates that a scenario in which there are no MACHOs is excluded with very high confidence, despite the large uncertainty in the halo fraction determinations. In the lower-right panel we see that the likelihood estimator has correctly determined that there is little, if any, contamination due to variable stars, with a 90% confidence upper limit of fvar < 0.03.
In Figure 11 we show the results for a simulation over one season in which there are no microlensing events, only variable stars. We adopt Nvar = 100 and fvar = 1 within the INT WFC fields. It is important to establish whether, in the event of there being no MACHOs, our likelihood estimator is able to correctly determine a null result even if a significant number of variable stars pass the microlensing selection criteria. The four panels in Figure 11 indicate that our estimator has been very successful as regards the M31 MACHO contribution. The M31 MACHO fraction is constrained with 90% confidence to be below 0.2 for lenses in the mass range 0.001 − 0.1 M ⊙ and below 0.4 for MACHOs up to a few Solar masses. This despite a rate in variable stars comparable to full haloes of MACHOs. In the upper-right panel we see that there is considerable uncertainty in the Galaxy MACHO parameters, though interesting upper limits on the halo fraction are obtained for lenses in the mass range 0.03 − 0.1 M ⊙ . In the lower-left panel we see that a non-zero MACHO contribution is preferred though the contours are consistent with the input model at about the 70% confidence level. In the lower-right panel we see that the estimator is able to constrain the number of variables to within ±30% of the input value. Thus our likelihood estimator has provided us with not just an estimate of the MACHO parameters but also an estimate of the level of contamination in the data-set. This estimate is completely independent of (and thus does not rely upon) additional information one might obtain from colour changes or asymmetry in the lightcurves of individual events, or from follow-up observations. Figure 12 shows another first-season simulation in which we adopt the same MACHO parameters as in Figure 10 but this time we also take Nvar = 100 and fvar = 1. The contours in c 0000 RAS, MNRAS 000, 000-000 Theory of pixel lensing towards M31 I 17 the plane of M31 MACHO mass and fraction appear largely unaffected by the presence of significant variable star contamination, and qualitatively resemble those in Figure 10. There is no evidence of estimator bias due to the presence of variables, which for our realization out-number the MA-CHOs from both haloes combined. However the Galaxy MA-CHO parameter estimation is clearly led astray by the presence of variables, with upper limits on halo fraction possible for only a narrow range of lens masses. The estimator nonetheless strongly excludes a no-MACHO hypothesis (lower-left panel) and provides a good estimate of variable star contamination levels. Figure 13 shows the constraints after three seasons assuming the same parameters as for Figure 12, except that we have reduced the contamination level to fvar = 0.3. A significant decrease in contamination would be expected as the increase in observation baseline permits the exclusion of a larger number of periodic variables. The constraints for M31 MACHO parameters have tightened up considerably, with a 90% confidence uncertainty of a factor four in halo fraction and an order of magnitude in MACHO mass. The constraints on Galaxy MACHO parameters have also sharpened considerably, allowing strong upper limits on the halo fraction to be made over a wide mass range, though the data in this case is consistent with a complete absence of Galaxy MACHOs. However, in the lower-left panel we see that the joint constraint on M31 and Galaxy MACHO fraction advocates a significant overall MACHO contribution. The lower-right panel also shows an accurate determination of contamination levels.

Evolution of parameter estimation
In Figure 14 we depict constraints for ten seasons of data, comparable to the lifetime of current LMC surveys, with the variable star contamination level reduced further to fvar = 0.1. The M31 MACHO fraction is now essentially specified to within about a factor of three, whilst the MA-CHO mass uncertainty is within an order of magnitude. We now also have a positive estimation of the Galaxy MACHO contribution and mass. The constraints on Galaxy parameters are only a little worse than those for M31 after three seasons. The variable star contamination level is once again robustly determined. Figures 12 to 14 show that the likelihood estimator is able to distinguish clearly between microlensing events and our naive model for the variable star population. They also show that, given a lifetime comparable to the current LMC surveys, a sustained campaign on the INT should determine M31 MACHO parameters rather precisely and should also provide a useful estimate of Galaxy MACHO parameters. A more modest campaign lasting three seasons would provide   Figure 10, with the same input parameters, except that we now adopt a variable star fraction of unity rather than zero. c 0000 RAS, MNRAS 000, 000-000 Theory of pixel lensing towards M31 I 19 Figure 13. As for Figure 12 but for three seasons of data and a variable stars fraction of 0.3. Figure 14. As for Figure 12 but for ten seasons of data, comparable to the lifetime of current LMC surveys, and a variable stars fraction of 0.1.