Bayesian Analysis of Gravitational Lensing (BAGLE)
- BAGLE is a Bayesian framework and Python package for modeling microlensing events with binary lenses and sources, enabling precise parameter recovery from photometric and astrometric datasets.
- It incorporates comprehensive modeling techniques including PSBL, BSPL, and BSBL scenarios along with static, linear, and full Keplerian orbital motion parameterizations.
- The framework resolves common microlensing degeneracies by jointly analyzing light curves and centroid shifts, which is essential for next-generation surveys like Rubin and Roman.
Bayesian Analysis of Gravitational Lensing Events (BAGLE) refers both to a suite of mathematical and computational frameworks for inferring parameters of gravitational microlensing events with binary (and higher-multiplicity) lenses and/or sources, and to the specific Python package "BAGLE," which implements these methods for contemporary photometric and astrometric datasets (Bhadra et al., 3 Dec 2025). Within microlensing, Bayesian inference plays a central role in navigating highly-degenerate, nonlinear parameter spaces to recover physical properties (such as lens masses, orbital elements, and distances) from photometric and astrometric time series, especially in the presence of binary orbital motion or multiple source trajectories.
1. Binary Lens and Source Formalism in BAGLE
The BAGLE framework introduces a comprehensive machinery for the modeling of binary-source point-lens (BSPL), point-source binary-lens (PSBL), and binary-source binary-lens (BSBL) microlensing events. In the standard PSBL scenario, the lens equation in complex notation is
with and image/source positions expressed in angular units (typically mas). The total magnification is given by summing over all image positions via the Jacobian determinant . For binary sources, independent sky trajectories and are projected through the lens, and their corresponding magnifications are flux-averaged in the observed light curve. For fully general BSBL events, the two sources are simultaneously lensed by the two (or more) masses, producing up to ten images in the static case (Bhadra et al., 3 Dec 2025).
2. Model Parameterization and Orbital Motion
BAGLE models extend beyond static lens and source configurations by incorporating three kinematic/kinematic parameterizations of orbital motion:
- Static binary: Fixed relative separation and orientation throughout the event.
- Linear or accelerated motion: Approximates the orbital evolution as a linear (constant ) or quadratic (constant ) perturbation, suitable for cases with .
- Full Keplerian orbits: Incorporates the complete set of orbital parameters (semi-major axis, eccentricity, inclination, argument of periastron, longitude of ascending node, mean anomaly at epoch) for either lens or source. The relative positions at any time are computed by solving Kepler’s equation to high precision; projected separations are calculated using the Thiele–Innes formulation (Bhadra et al., 3 Dec 2025).
These parameterizations enable consistent modeling of events where the orbital period is comparable to , or the eccentricity is significant, and are crucial for joint photometric and astrometric analysis.
3. Bayesian Fitting Framework and Likelihood Construction
The Bayesian inference pipeline in BAGLE is structured around the posterior probability
where is the multi-dimensional parameter vector and are the observed data (typically a time series of fluxes and/or centroid positions). Likelihood terms include photometric residuals,
and (if available) astrometric residuals,
Priors may either be uninformative, or informed by Galactic stellar populations, lens/source distributions, or empirical knowledge of binary statistics. Efficient parameter space exploration is accomplished by MCMC (e.g., emcee) or nested sampling (dynesty), with convergence monitored through autocorrelation or other diagnostics. For computational efficiency, precomputed "model objects" retain relevant geometric and parallax data to avoid recomputation during high-dimensional likelihood evaluations (Bhadra et al., 3 Dec 2025).
4. Joint Photometric and Astrometric Modeling — Degeneracy Resolution
A central motivation for the BAGLE design is the resolution of classic microlensing degeneracies that cannot be broken by photometry alone. Notable examples:
- Close–wide binary-lens degeneracy: Configurations with separation and $1/s$ yield similar light curves but distinct astrometric centroid shifts, enabling discrimination via astrometric data (Bhadra et al., 3 Dec 2025).
- Sign of : The impact parameter’s sign (source passing above or below the lens) is photometrically degenerate, but the direction of centroid motion breaks this symmetry.
- Flux-blend degeneracies in binary-source events: Blending ambiguities are resolved by the centroid motion, which responds directly to the spatial and temporal separation of the two source tracks.
COM orbital motion (lens or source) imparts unique, time-dependent curvature to the astrometric trajectory, allowing lens and source binarity to be disentangled given sufficient astrometric sampling.
5. Application Scope and Observational Strategies
The BAGLE machinery is targeted at the analysis of next-generation microlensing data products from surveys such as the Rubin Observatory and Roman Space Telescope, which routinely deliver both high-cadence photometry and sparse or dense astrometric time series. For events with binary lenses/sources, the package supports the following workflows (Bhadra et al., 3 Dec 2025):
- Initial event characterization through PSBL/BSPL fitting, to triage for follow-up.
- Automated inclusion of full Keplerian orbital effects if the event timescale or anomaly structure warrants.
- Simultaneous Markov Chain Monte Carlo estimation of all physical and orbital parameters.
- Statistical model selection among alternative interpretations (e.g., 2L2S vs 3L1S).
- Inference of lens mass, distance, projected and true orbital separations and periods, and proper motions from posterior distributions, subject to photometric, astrometric, and external (e.g., spectroscopic) constraints.
Table: Key Parameter Types in BAGLE Binary Modeling
| Parameter Group | Examples | Typical Use |
|---|---|---|
| Geometry | , , , , , | All scenarios |
| Flux | , , , | Photometry, blending |
| Keplerian Orbit | , , , , , , | Full BSBL/PSBL |
| Parallax | (East, North) | Long events |
| Astrometry | , , centroid shifts, | Astrometric tracks |
6. Examples and Physical Parameter Recovery
Canonical use cases implemented in BAGLE include:
- PSBL events with binary-lens separations (), Einstein timescales , and proper motions in the mas yr range, producing two-peak caustic-dominated light curves and 0.5 mas centroid loops.
- BSPL events where the binary source's orbital motion is resolved via astrometric wobble, with flux ratios and projected source separation 3–8 mas.
- Fully generalized BSBL cases in disk and bulge fields, embedding astrometric and photometric data in a Bayesian post-processing chain to yield posterior distributions in (mass, distance, orbital separation) parameter space (Bhadra et al., 3 Dec 2025).
7. Broader Context: Degeneracies, Model Selection, and Future Prospects
In the wider context, BAGLE represents an overview of advances in microlensing degeneracy-breaking, Bayesian hierarchical modeling, and computational orbit fitting. The inclusion of joint photometric-astrometric analysis is critical for forthcoming Roman and Rubin datasets, which are expected to routinely deliver complex events with overlapping light-curve and centroid anomalies due to binarity in both lens and source populations.
The framework naturally integrates with established Bayesian methodologies for quantifying uncertainty, prioritizing follow-up, and contextualizing individual solutions within Galactic stellar population priors. This modular approach is directly motivated by years of degeneracy-dominated analyses in the literature (Hwang et al., 2010, Han et al., 14 Nov 2024, Chung et al., 26 Jun 2025), and is now implemented in open-source packages for cross-survey compatibility and reproducibility.
In summary, BAGLE provides both the theoretical infrastructure and computational toolset for robust, end-to-end Bayesian inference of physical lensing parameters in complex microlensing events, with explicit support for complete Keplerian orbits, combined photometric and astrometric likelihoods, and a flexible, extensible model-selection formalism (Bhadra et al., 3 Dec 2025).