## Abstract

If gamma-ray bursts are at cosmological distances, they must be gravitationally lensed occasionally^{1,2}. The detection of lensed images with millisecond-to-second time delays provides evidence for intermediate-mass black holes, a population that has been difficult to observe. Several studies have searched for these delays in gamma-ray burst light curves, which would indicate an intervening gravitational lens^{3,4,5,6}. Among the ~10^{4} gamma-ray bursts observed, there have been a handful of claimed lensing detections^{7}, but none have been statistically robust. Here we present a Bayesian analysis identifying gravitational lensing in the light curve of GRB 950830. The inferred lens mass *M*_{l} depends on the unknown lens redshift *z*_{l}, and is given by \((1+z_{\rm{l}})M_{\rm{l}} = 5.{5}_{-0.9}^{+1.7}\times 1{0}^{4}\,M_{\odot}\) (90% credibility), which we interpret as evidence for an intermediate-mass black hole. The most probable configuration, with a lens redshift *z*_{l} ≈ 1 and a gamma-ray burst redshift *z*_{s} ≈ 2, yields a present-day number density of about \(2.{3}_{-1.6}^{+4.9}\times 1{0}^{3}\,{\text{Mpc}}^{-3}\) (90% credibility) with a dimensionless energy density \({{{\varOmega }}}_{{\rm{IMBH}}}\approx 4.{6}_{-3.3}^{+9.8}\times 1{0}^{-4}\). The false alarm probability for this detection is ~0.6% with trial factors. While it is possible that GRB 950830 was lensed by a globular cluster, it is unlikely as we infer a cosmic density inconsistent with predictions for globular clusters *Ω*_{GC} ≈ 8 × 10^{−6} at 99.8% credibility. If a significant intermediate-mass black hole population exists, it could provide the seeds for the growth of supermassive black holes in the early Universe.

## Main

The evidence for a cosmological population of intermediate-mass black holes (IMBHs) is mounting. They have long been posited to reside in the cores of globular clusters. Dynamical friction in stellar clusters causes the most massive stars to sink to the bottom of the cluster’s gravitational potential. Since 2004, simulations have indicated that, for small compact clusters, stellar mergers happen within the lifetime of giant stars^{8}. Critically, these mergers occur before the stars go supernova and disturb the system, leading to a runaway collision and the formation of an ~10^{3} *M*_{⊙} megastar. These short-lived monsters could seed IMBHs, which subsequently grow through accretion and mergers. Yet direct observational signatures of their existence are elusive.

Their large mass puts the majority of IMBH mergers outside the sensitivity range of the current generation of gravitational-wave detectors. The Advanced Laser Interferometer Gravitational-wave Observatory (LIGO)^{9} and Virgo^{10} are sensitive to mergers with a total merger-product mass of ≲400 *M*_{⊙}. Furthermore, IMBHs are too small to be observed using the same techniques employed to detect supermassive black holes in galactic nuclei. They are either not massive enough or live in a state of starvation, unable to accrete enough gas to power quasar-like emission.

Astronomers are converging on the population of IMBHs from both ends of the black hole mass spectrum. Compact object mergers detected by LIGO–Virgo are uncovering a population of black holes edging closer to the range traditionally reserved for IMBHs^{11}, including the recent discovery of a 150 *M*_{⊙} merger product^{12}. From the other end, the lower limit on supermassive black holes in the nuclei of dwarf galaxies is descending^{13}. There have been recent findings of compact objects with mass [10^{4}–10^{5}] *M*_{⊙} residing in galactic cores^{14,15}. Observations of a tidal disruption event from the evisceration of a star by a black hole’s tidal field suggest an IMBH resides in a star cluster on the outskirts of a barred lenticular galaxy^{16}. In this Letter, we provide evidence for an IMBH using gravitational lensing. Gravitational lensing is one of the few ways to directly constrain IMBH population statistics by providing an estimate for the number density of IMBHs.

In strong gravitational lensing, photon paths from a background source are distorted due to curved spacetime, producing multiple images. The relative fluxes and the difference between arrival times for each image can be used to infer the gravitational structure of the lens. In the case of a compact lens, the mass can be directly determined up to a redshift factor. The fraction of distant sources that experience multiple imaging is directly proportional to the dimensionless energy density of compact lenses, *Ω*_{lens} ≡ *ρ*_{lens}/*ρ*_{c} (ref. ^{17}), where *ρ*_{lens} is the energy density of lenses and *ρ*_{c} is the critical energy density required for a flat Universe. This fraction is independent of the lens mass, *M*_{l}. Strong lensing is accompanied by an overall magnification, typically a factor of a few in flux. This allows us to probe more distant sources, or sources that would otherwise be too faint to detect.

Gamma-ray bursts (GRBs) are extremely luminous bursts of γ-rays, with peak energies of 100–300 keV. They are thought to be generated by the rapid infall of material onto a nascent stellar-mass black hole, formed through either a collapsar supernova or a compact object merger. Some of the accreting material is launched in ultrarelativistic, bipolar jets along the rotation axis. A fraction of this outflow is converted into electromagnetic radiation, which is Lorentz-boosted into γ-rays. The cosmological nature of GRBs is well established by both the isotropy of observed events^{18} and redshift measurements of their optical afterglow^{19}. A cosmological origin implies that at least some fraction of the GRB population must be strongly lensed^{1}.

Gamma-ray detectors, unlike those used for optical or infrared astronomy, have comparatively poor angular resolution, but good temporal resolution. Thus, we do not expect to resolve a gravitationally lensed image pair in γ-rays. However, a time delay between the two images, resulting from the differences in geometric path and relative differences in gravitational field strength, can be observed. The photons that travel a longer distance arrive first, as the shorter path traverses deeper into the gravitational potential well of the lens where time dilation is stronger. The gravitationally retarded image is dimmer than the first image. The observational signature of such an event is thus an initial γ-ray pulse followed by a duplicate ‘echo’. The duration of the time delay between the burst and the echo is predominantly determined by the mass of the gravitational lens, but also by the alignment of the γ-ray source with respect to the observer-lens line of sight. For a point-mass lens^{20,21,22}

Here Δ*t* is the time delay, *r* is the ratio of the fluxes, *z*_{l} is the lens redshift and (1 + *z*_{l})*M*_{l} is the redshifted lens mass. By measuring Δ*t* and *r* we can infer the redshifted mass (1 + *z*_{l})*M*_{l}.

The total number of observed GRBs is of order 10^{4}. We analyse the BATSE dataset as it is the largest available single dataset at ~2,700 bursts. We include both long and short GRBs in our study. For a burst and echo to occur within the same BATSE light curve, we require a time delay of ≲240 s. The minimum detectable time delay is determined by the width of the γ-ray pulse; if the delay time is too short, the two images merge into one. For long GRBs, the minimum detectable time delay is ~1 s, and for short bursts, it is ~40 ms. This range of time delays corresponds to a lens mass range of approximately 10^{2}–10^{7} *M*_{⊙} (refs. ^{21,23}).

We identify preliminary lensing candidates with an autocorrelation analysis^{7,24}. We utilize the four available broadband energy channels of BATSE burst data independently. The equivalence principle dictates that all wavelengths of light are equally affected by gravitational fields. This implies two constraints: the time delay is independent of the photon energy and the gravitational magnification of each image is identical for every wavelength. Once we have identified candidates, we employ Bayesian model selection to determine the Bayesian odds comparing the lensing hypothesis to the no-lensing hypothesis. Our unified framework simultaneously provides the detection significance while estimating the lensing parameters, which we use to infer the lens mass. To model GRB pulses, we employ the fast-rise exponential-decay (FRED) model^{25}. Details are provided in Methods.

We uncover one statistically significant gravitational lensing candidate: GRB 950830 (BATSE trigger 3770)—a short γ-ray burst. The light curve for this burst is shown in Fig. 1 with the reconstructed curve of the best-fit model plotted in black. The black curve is created by taking the mean of the curves drawn by each of the ≳60,000 posterior sample sets at each time bin. We find that each individual pulse is best fit by a variation of the FRED pulse model plus a sine-Gaussian function. We analyse the four available energy channels independently and find that the lensing hypothesis is preferred in each channel with ln(Bayes factor) (ln(BF)) between 0.5 and 7.0. Adding the ln(BF) values from each of the channels, we find the total ln(BF) = 12.9 (log_{10}BF = 5.6) in favour of lensing, indicating strong statistical support for the lensing hypothesis. A ln(BF) value of eight is considered ‘strong evidence’ in support of one model over the other^{26}. Detailed fits are shown in Extended Data Figs. 1–6, including an example of a ’double’ burst that is not a lens (Extended Data Figs. 7 and 8).

Assuming a point-mass deflector, the marginalized posterior distributions for time delay and magnification ratio of this lensing event in Fig. 2 can be used in conjunction with equation (1) to infer a redshifted lens mass of (Fig. 3)

There are three astrophysical objects in this mass range, which might serve as a lens: globular clusters, dark matter halos and black holes. A gravitational lens is well approximated as a point mass if most of its mass is contained within the region bound by the two lensed images where they bisect the cosmological plane of the lens. Taking instead an isothermal mass distribution as the gravitational lens, and integrating over all *z*_{l}, *z*_{s}, where *z*_{s} is the source redshift, we find a lens velocity dispersion of ~4 km s^{−1}. From simulations, we can associate this dispersion with an Navarro–Frenk–White profile of mass ~10^{5} *M*_{⊙} (S. Wyithe, personal communication). Globular clusters follow a similar mass–velocity dispersion scaling^{27}. In either framework then, either a singular point mass or a self-gravitating isothermal sphere, we have a consistent measurement for the mass.

Dark-matter halos are numerous, and their number density can be calculated using the Press–Schechter formalism. However, each has a negligible contribution to lensing cross-section, as Navarro–Frenk–White mass distributions typically have cores that are not sufficiently massive to produce multiple images. Globular clusters are compact enough to produce multiple images, but there are not many of them. Assuming that the Milky Way’s ~200 globular clusters are typical, and that the Milky Way formed from an overdensity of approximately 20 Mpc^{3}, then the number density of globular clusters is approximately 10 Mpc^{−3}, giving \({{{\varOmega }}}_{{\rm{GC}}}\left(1{0}^{5}\,{M}_{\odot }\right) \approx 8\times 1{0}^{-6}\)—significantly lower than the mean density implied by GRB 950830.

Following ref. ^{17}, we use the optical depth *τ* to estimate the cosmological density, \({{\varOmega }} \approx \tau \left(\langle{z}_{s}\rangle\right)\). Assuming that BATSE γ-ray bursts have a mean redshift of two, the IMBH energy density is

The present-day number density of IMBHs is

(90% credibility), where we have assumed a lens redshift of *z*_{l} ≈ 1. The uncertainty is from Poisson counting statistics. Thus, there should be approximately \(4.{6}_{-3.2}^{+9.8}\times 1{0}^{4}\) in the neighbourhood of the Milky Way. There are approximately 10^{8} stellar-mass black holes in the Milky Way^{28}. Assuming all stellar-mass black holes are bound to galaxies, which have a number density *n*_{gal} ≈ 0.04 Mpc^{−3}, then the number density of stellar-mass black holes is *n*_{stellar} ≈ 10^{7} Mpc^{−3}. Our result for the IMBH density is consistent with the stellar-mass black hole density assuming that number density scales as ~*M*^{−1}. Note that the mean redshift of Swift short GRBs is \(\langle{z}_{{\rm{s}}}\rangle\approx 0.8\). If the GRBs in the BATSE sample had the same mean, then the inferred cosmological density *Ω*_{IMBH} would increase by about an order of magnitude. Extended Data Figs. 9 and 10 give results at different source and lens redshifts.

Our estimate for *Ω*_{IMBH} is consistent with the null result of other GRB lens searches^{6,29}, which are sensitive to different lens masses. The Fermi and Konus–Wind catalogues are similar in size to the BATSE GRB catalogue, and there is ~50% probability that these contain another GRB that is gravitationally lensed by an IMBH. In addition, due to the relatively flat GRB luminosity function^{23}, the uncertainty in *n*_{IMBH} derived from a single lensing event is more significant than the potential magnification bias.

If this detection represents the first determination of the space density of IMBHs, then it may shed light on open questions in astrophysics. How are the supermassive black holes that power quasars so massive at high redshift? Are IMBHs gravitationally bound to galaxies? Do they have observational signatures in electromagnetic or gravitational radiation? What is their relationship to the globular cluster population? Are they the remnants of direct collapse of 10^{4}–10^{6} *M*_{⊙} dark matter or baryonic clouds in the early Universe? The identification of additional lensing candidates in the GRB catalogues will confirm this result, and allow a more precise determination of *Ω*_{IMBH}.

## Methods

We start with a general overview of GRB lensing to place our research within the context of the wider field. From there, we describe our selection method for finding gravitationally lensed GRB candidates. We then discuss the statistics of photon counting in γ-ray astronomy. We construct a Bayesian framework with a model for the lensing signal and γ-ray background. We go on to discuss the validity and robustness of our results. We include calculations to determine the optical depth to lensing for a source population at mean redshift \(\langle{z}_{{\rm{s}}}\rangle\), and provide evidence against the alternative hypothesis, that GRB 950830 was lensed by a globular cluster. We derive the uncertainty on our estimate for the number density of IMBH *n*_{IMBH}. We also include an estimate of the false alarm probability, both with and without trial factors. Finally, we include a candidate identified by the autocorrelation detection algorithm but strongly rejected by our Bayesian analysis for illustrative purposes.

### A brief literature review

Gravitational lensing studies of γ-ray bursts typically come in one of two flavours. There are autocorrelation studies, which search for echoes of the γ-ray burst within the same light curve. Then there are cross-correlation studies, which compare the light curve similarity of two separate GRB triggers on a per-bin basis. These are typically accompanied by positional coincidence statistics, which check whether the GRBs have consistent source locations. Our study is of the first flavour.

Traditional strong gravitational lensing refers to the multiple imaging of, for example, quasars due to galactic-mass gravitational lenses. Also known as macrolensing, fiducial image separations are on the order of arcseconds, with inter-image time delays of days to years depending on the lens geometry and source-lens alignment. Millilensing (or mesolensing) is loosely defined as gravitational lensing due to million solar mass objects^{30}, and produces time delays of the order of seconds. The conversion between mass and time delay is

for a Schwarzschild potential^{21}. In essence, millilensing fills the mass range between traditional strong lensing and microlensing whereby stars acting either alone or in unison in galaxies^{31,32,33} produce multiple images with roughly microsecond time delays. At the more extreme end, nanolensing^{34} (~10^{−6}–10^{−1} *M*_{⊙}), picolensing (~10^{−1}–10^{−7} *M*_{⊙}) and femtolensing^{35} (~10^{−16}–10^{−13} *M*_{⊙}) describe deflections and interference effects due to planetary and subplanetary mass gravitational lenses.

Autocorrelation probes millilensing echoes from ~10^{2}–10^{6} *M*_{⊙} gravitational lenses. The minimum lens mass is determined by the temporal resolution of the instrument in addition to the variability timescale and duration of the burst. The upper mass limit is determined by the instrumental cutoff of data recording after the event trigger. Numerous autocorrelation searches of the BATSE database have been done using the summed 64 ms light curves^{7,36,37}. Autocorrelation has been used on the Fermi GBM and Swift BAT catalogues^{6}, with a null result for lenses masses of 10^{1}–10^{3} *M*_{⊙}.

Cross-correlation studies probe time delays equal to the difference in arrival time of the two bursts. The observation of the second image is inhibited by Earth occultation. This sets a minimum observable time delay, since γ-ray observatories typically have ~90 min orbital periods. Recent work on the Fermi GBM response shows how the observation conditions of a γ-ray burst significantly affect the inferred spectrum^{38}. The effects of detector angular response, energy response, atmospheric scattering, accumulated particle precipitation, cosmic background and galactic sources, such as the Sun or Crab Pulsar, complicate cross-correlation studies. No-lensing studies have looked for GRB lensing across multiple observatories due to the inherent difficulties comparing light curves from instruments with different energy responses. Cross-correlation studies of the BATSE database are also numerous^{39,40}, in addition to Fermi GBM^{41}. A study of Konus–Wind GRBs searching for time delays of roughly hours to ~25 years (lens masses of 10^{8}–10^{13} *M*_{⊙}) was further augmented by the inclusion of spectral analysis^{29}. Another lens identification technique involves correlation of the cumulative light curve in three spectral dimensions^{42}. Correlation-free approaches include a model-agnostic statistical method, which does take into account Poisson statistics^{3} and Fourier analysis methods^{4}. For a comprehensive review of the gravitational lensing of transient events, see refs. ^{29,43}.

### Candidate selection

The BATSE catalogue contains 2,704 triggered γ-ray bursts. Of these, 2,629 have discsc bfits (64 ms) light curves available for download. Furthermore, higher-time-resolution observations are available for 2,446 of these γ-ray bursts, with 2,435 existing as pre-binned tte bfits (5 ms) light curves. We carry out a preliminary autocorrelation search (described below) on both the discsc bfits and tte bfits pre-binned light curves. Candidate detections are followed up with further analysis. In total, we carry out autocorrelation on 2,679 unique γ-ray bursts.

Signal (auto)correlation can be used to measure the time delay of temporally overlapping signals of a gravitationally lensed system^{24}. We define the autocorrelation function (ACF) as

where the sum in the numerator is taken over the bins where the two signals overlap, and the sum in the denominator is taken over the entire input signal^{7,24}. Here *I*(*t*_{j}) is the count rate at time bin *t*_{j}, *N* is the total number of bins and *n* the total number of overlapping bin, where *j* and *k* index these bins in the summations.

We fit a third-order Savitzky–Golay filter *F*(δ*t*) to the ACF. The dispersion *σ* between the ACF and the fit *F*(δ*t*) is

where *N* is the total number of bins. We identify 3*σ* outliers as gravitational-lensing candidates^{6,7}. Furthermore, we autocorrelate each of the four BATSE LAD energy channels, and perform the same filtering process. Gravitational lensing is achromatic for point sources, so we expect that each channel of a candidate lens GRB should autocorrelate with the same time delay. We check that candidates yield lensing signals in both the summed light curve and individual energy channels.

### Photon counting

Photon counting is a Poisson process. High-energy satellites such as BATSE accumulate photons at a series of discrete times, *t*_{1}, *t*_{2}, ... *t*_{n}. For BATSE, these photons are collected with a sampling frequency of 500 kHz. In most cases, hardware limitations require that the BATSE photon arrival times (time-tagged events; TTEs) are downsampled before transmission to Earth. Only the shortest, moderately bright bursts are completely contained within the TTE photon-list data. Fortunately, this is the case for GRB 950830. For bursts not completely encoded in a TTE list, the counts are averaged into 64 ms bins before transmission, typically recorded for ~240 s after triggering. We ignore the fact that BATSE has a small dead time (of about one clock cycle) after each count as this is only becomes import for very bright bursts that saturate the detector.

If we consider a single time stamp *t*_{i}, the likelihood of observing *N*_{i} photons is given by Poisson counting statistics

The expected number of photons, *λ*_{θ} is

Here δ*t*_{i} is the sampling time and *R*(*t*_{i}∣*θ*) is the photon rate (in units of photons per unit time) evaluated at time *t*_{i} and given model parameters *θ*. The sampling time, δ*t*_{i}, is subscripted with index *i* to account for the cases where the time resolution in the available data changes during an event. The rate can be written as a sum of signal *S* (from the GRB) and background *B*

To first order, the background is constant, but the signal varies with time according to model parameters *θ*.

The likelihood of observing \({\bf{N}}={N}_{1},{N}_{2},...\) photons at times *t*_{1}, *t*_{2}, ... is given simply by taking the product of the likelihood functions evaluated at different times

It is easier, though, to work with the ln likelihood, which is

### Bayesian inference

There are two goals of Bayesian inference. The first is to derive posterior distributions *p*(*θ*∣*d*) for our model parameters, which enables us to determine their credible intervals. The second goal is to calculate the Bayesian evidence \({\mathcal{Z}}\) for a set of models to do model selection. The Bayes theorem

relates the posterior probability density *p*(*θ*∣*d*) of model parameters *θ* given the observed data *d*, to a likelihood function \({\mathcal{L}}(d| \theta )\) and prior probability density *π*(*θ*). The likelihood function is a mathematical description of the probability of observing the data with the given model parameters. The priors are probability distributions for what we expect these parameters to be, which, in our case, are informed by the BATSE GRB population. The evidence, also called the marginal likelihood, is a normalization factor that gives information about the quality of the fit of the model to the data averaged over parameter space, viz

We define different models for

which we use to do Bayesian inference. The null model *M* = *M*_{null} states that there is no lensing. The lens model *M* = *M*_{l} states that there is lensing. We adopt the FRED pulse model, which is ubiquitous in GRB pulse modelling:

Here *A* is a vertical *y*-scale factor, *τ* is a duration scaling parameter, *Δ* is the time delay and *ξ* is an asymmetry parameter, which can be used to adjust the skewness of the pulse. A more generalized form of this model has additional exponents, *γ*, *ν*, allowing for flatter/sharper peaks, viz

We call this the extended FRED model, or FRED-X for short. An analytic normalization exists for both the FRED and FRED-X models, which decouples the maximum height of the pulses from every parameter except *A*, such that *A* is the maximum amplitude of the pulse. Structured pulses can be modelled as either multiple overlapping pulses, or by accounting for the residual structure with another parameterization. Thus, a single channel FRED light curve requires 4*n* + 1 parameters, where the +1 corresponds to the constant background parameter *B*. For bursts with many pulses, our model is:

Our prior enforces

to ensure that we are not fitting the same pulse configuration in different permutations.

The FRED model has proved a popular phenomenological fit due to its simplicity and a posteriori applicability to certain GRB progenitor models. Some authors have noted (and we confirm here) that there is a systematic residual structure, visible after subtracting the best-fit FRED and FRED-X models from a GRB light curve, indicating an imperfect fit^{44}. We model these residuals using a sine-Gaussian wave packet

where *ω* and *φ* are fitted constants, as it is ubiquitous in physics and provides an adequate fit to the residual structure. The residual is part of our signal model, so we fit it simultaneously to any FRED pulses:

The lens model is similar to the null model, but with two extra parameters used to describe the delayed signal:

where the lens parameter vector *θ*_{lens} subsumes the null parameter vector *θ*_{null} in addition to the time delay, Δ*t*, and magnification ratio, *r*. The parameter *r* reduces the amplitude of the delayed signal while the parameter Δ*t* describes the size of the delay. Thus, the lens model requires 4*n* + 3 parameters, where *n*_{lens} is typically about half *n*_{null}.

To determine which model is favoured, we calculate the Bayesian evidence for each model:

Here *π* denotes a prior distribution and **N** is the vector of photon counts. Once we have each evidence, we obtain the ln(BF)

The BF is a statistically rigorous measure of which model the data prefer. A ln(BF) ≳ 8 is considered ‘strong evidence’ in support of one model over the other^{26}.

To perform parameter estimation and evidence calculations, we use the Bilby Bayesian inference library^{45}. We employ nested sampling^{46,47}, taking advantage of the multi-ellipsoid bounding method^{48}, with dynamically updated sampling points^{49}. Results tend to be unimodal, but we use multi-ellipsoid bounding regardless due to its flexibility and speed in the case of multimodal results. Some parameters recover bimodal distributions, particularly in pulse start times *Δ*_{j}, due to the pre-binning of the BFITS datatype analysed.

### Priors

The priors are tabulated in Table 1. We use log-uniform priors on parameters, which typically vary by orders of magnitude and uniform priors for other parameters. The prior ranges are informed by the BATSE GRB population. We fit models to a large selection of isolated, individual pulses to develop intuition for the practical bounds of the priors. A more sophisticated analysis would employ hierarchical inference to infer the shape of the prior distributions, but we leave this for future work. The priors for quantities related to time (*Δ*, *Δ*_{res}, Δ*t*) are taken to be uniform. The prior range depends on the particular trigger being investigated, as the GRB population is (bimodal) log-normal in duration over many orders of magnitude. Thus the priors must be chosen appropriately for a region of time that will contain all the pulses. Care is taken with the time delay prior to ensure that the extra pulses due to lensing are not occurring outside the light curve under investigation. In addition, the prior forces the second pulse to occur after the first pulse.

### Results and interpretations

For GRB 950830, we find that lensing is strongly preferred over two-pulse models. The two pulses in Fig. 1 are so alike that the data prefer a fit with a single set of pulse parameters. Thus, a single pulse seen twice with delay time Δ*t* and reduced in brightness by some scaling factor *r* is the preferred model compared with a more complex model with two completely independent pulses. We interpret this result as evidence that GRB 950830 was strongly lensed.

A lensed FRED-X model with a sine-Gaussian residual is the preferred model (see equations (18) and (21) for the signal model). There is only a single pulse, which is later repeated, so *j* ∈ {1}. The fits to the light curve for each channel are shown in Extended Data Figs. 1–4. The median fits of the FRED-X pulses and sine-Gaussian pulses are plotted individually, and the sum of both is shown in the third panel of each figure. There are also 100 individual posterior draws for each model to show the breadth and multi-modality of the fits. Compared with the corresponding two-pulse model, the lens model is favoured by ln(BF) = 12.9. We find that other lens models are similarly favoured. No matter which pulse model we implement, the lensing hypothesis is always favoured. The simplest model comparison comparing a single lensed FRED pulse to a null model with two independent FRED pulses has the largest BF with ln(BF) = 24.5.

A model with more parameters is naturally penalized in Bayesian model selection by virtue of the larger region of prior volume explored when calculating the Bayesian evidence^{26}. We therefore ask: is the lens model favoured because an additional pulse simply adds such a great volume to our prior space? We investigate the effect of prior volume on the model selection to assure ourselves that we have not arrived at a spurious result. The extra parameters in the FRED-X model are *γ* and *ν*. We test priors on *γ* and *ν* in the ranges, (10^{−1}, 10^{1}), (10^{−2}, 10^{2}) and (10^{−3}, 10^{3}) in both uniform and log-uniform spaces. We also include a narrow Gaussian prior centred on the values found in previous analysis (typically between 1/4 and 4). In all, we study seven different prior volumes for two models in each of the four channels. The effect on the resultant model selection is minimal. Looking at the corresponding pairs of null and lens models which have the same priors, we find the ln(BF) changes by ~1–2.

Channel 3 (green) exhibits the greatest variation in its BF, likely due to having the highest signal-to-noise ratio. For channel 4 (blue), the inclusion of a sine-Gaussian residual makes the two-pulse (null) model marginally preferred (ln(BF) ≈ 1) over a lens model. The ln(BF) values in favour of lensing are ~2–5 per channel, depending on the prior. The total BF quoted in the main body of the paper assumes log-uniform priors for *γ* and *ν* on (10^{−1}, 10^{1}). In any case, the two parameters used to infer the lens mass are largely independent of the model or choice of priors. We find that our result is independent of the nested sampling package, for example, Dynesty^{50} and Nestle (http://kylebarbary.com/nestle/), used to run the analysis.

As a sanity check, we apply our analysis not only to the pre-binned tte_bfits data, but we also take the photon arrival time data (tte_list) and run the analysis again on the counts incident at each triggered detector. There are three: detectors 5, 6 and 7. We bin the count data to 0.005 ms bins to match the pre-binned light curve and repeat our analysis. We find that there is no change to the model section. While individual Bayesian evidence factors and therefore model comparison BF fluctuate when considering different data, the lensing model is consistently preferred in each channel for each triggered detector.

We also analyse the hardness of GRB 950830. The hardness duration of GRB 950830 and the rest of the BATSE GRB population with published T90’s is shown in Extended Data Fig. 5. The hardness *H*_{32} is defined as background counts in channel 3 (110–320 keV, green) to the counts in channel 2 (60–110 keV, yellow). We estimate the background by taking the mean of the bins outside the trigger region of the burst light curve. We find that the hardness of pulse A (2.09 ± 0.10) and pulse B (1.83 ± 0.11) of GRB 950830 agree within statistical errors. We expect two lensed pulses to exhibit the same hardness as lensing is achromatic for point sources. The slightly different duration between the two pulses (160 ms, 130 ms) is due to the lower amplitude of the second pulse (pulse B). We apply a two-component Gaussian mixture model to segregate long and short γ-ray bursts. The duration and hardness of GRB 950830 are typical of a short γ-ray burst. We have included the autocorrelation of the light curve of GRB 950830 in Extended Data Fig. 6.

To improve our analysis, we could a priori constrain the magnification ratio and time delay to be the same parameter in each of the spectral channels. The eight parameters in the lens model—two from each channel—are reduced to just two shared between the four energy channels. However, analysing the channels separately provides an independent check that the magnification ratios and time delays are consistent, in accordance with the equivalence principle (cf. Fig. 3 and Extended Data Fig. 8). Below, we revisit this topic, analysing the data with multiple channels simultaneously. Doing this four-channel nested sampling analysis on the FRED-X model with a sine-Gaussian residual becomes prohibitively expensive. Since we believe that this will only increase the Bayesian evidence in favour of lensing, and as our result is already quite strong (ln(BF) = 12.9), we leave this analysis for future work.

Furthermore, we could include a spectral model to relate the pulse fits in the four channels, reducing the number of free parameters in our model. The canonical GRB spectra model—the Band function—is a time-averaged spectra^{51}, which would not suit our purposes of a time-evolving spectra. Addition of a spectral model requires the analysis of four time series simultaneously, which is computationally challenging. We leave this as a goal for future work.

Another future goal is to use hierarchical inference to infer the prior distributions for FRED-X parameters using the full catalogue of GRBs, the vast majority of which do not contain a lens. This would yield priors consistent with the population properties of GRBs. Again, we expect this to only strengthen the evidence in favour of lensing. Finally, we do not fully utilize the available high-resolution (TTE-list data), since this requires analysis of an 800,000 unit time series. This analysis is prohibitively expensive for the many-parameter models. We are able to run a simple FRED model equation (17), and found that lensing was similarly favoured in all channels when running the analysis with the pre-binned BFITS data.

We have thus far assumed that we expect each image of a gravitationally lensed GRB will be statistically consistent. We have not discussed the many potential causes for anisotropy between the images. Gamma-ray bursts are highly beamed due to the ultrarelativistic velocities (*γ* ≈ 10^{3}–10^{4}) of their progenitor outflow. This results in the viewing angle onto the emission surface becoming important, since the radiation is beamed within an angle of *θ* ≈ *γ*^{−1}. The difference in viewing angle onto the source scales with the mass of the lens—the more massive the lens, the stronger the deflection, the greater the original angular separation of the lines of sight onto the source. Assuming a homogeneous emission surface, both lines of sight onto the source should be viewing the same region for masses *M*_{l} ≲ 10^{12} *M*_{⊙}. For larger masses, the deflection angle becomes great enough such that the observer is viewing two emission regions that may not be in casual contact, thus the gravitationally lensed images need not be identical. For smaller lens masses, anisotropy in the GRB emission surface can result in the images having inherent differences. Finally, as discussed earlier, the detector orientation and energy response can have a significant effect on the inferred energy spectrum, potentially resulting in a false negative identification of a gravitationally lensed pair of γ-ray bursts.

### Method limitations

Our method provides advantages over model-agnostic approaches such as correlation, which do not include all available information, for example, Poisson counting statistics. Bayesian inference provides a natural framework to make quantitative statistical statements about preferred models. Our methodology provides a metric for detection significance, and successfully rejects dubious candidates, which trigger an autocorrelation detection (see ‘A rejected candidate’). Of course, the results of Bayesian inference are only as good as the choice of model and priors. We try a variety of pulse models and prior ranges to ensure our results are robust, and find that the statistically identical pulse model is consistently preferred. This does not preclude the existence of a better pulse model. We have shown that the gravitational lens candidate GRB 950830 is robustly detected using both traditional GRB lensing techniques and our Bayesian inference method.

Finally, we point out that any method relying on self-similarity can produce false positive lensing candidates if identical repeating pulses are a feature of some γ-ray bursts. However, we regard the ‘intrinsic self-similarity’ hypothesis as unlikely as the vast majority of GRBs are not seen to repeat, and we cannot think of a physical mechanism that would cause a subpopulation of short GRBs to emit identical pulses.

### Estimate of optical depth

A rough estimate for the optical depth to strong gravitational lensing is

where *N*_{lens} is the number of multiply imaged GRBs and *N*_{GRB} is the total number of GRBs in our dataset. We find *N*_{lens} = 1 lensed GRB in a dataset of *N*_{GRB} = 2,679, so the lens probability is \(P(\tau ) \approx \tau =3.{7}_{-2.6}^{+7.8}\times 1{0}^{-4}\) (90% credibility), where we have used a Jeffreys prior. We may relate the energy density of lenses to the optical depth, \({{{\varOmega }}}_{{\rm{l}}} \approx \tau (\langle{z}_{{\rm{s}}}\rangle)\) (ref. ^{17}), where \(\langle{z}_{{\rm{s}}}\rangle\) is the mean redshift of sources in the sample.

For a point mass and a point lens, the angular Einstein radius of the lens is

Here *G* is the gravitational constant, *c* the speed of light and *M*_{l} the mass of the gravitational lens. The angular diameter distances are defined as \({d}_{{\rm{A}}}({z}_{{\rm{l}}},{z}_{{\rm{s}}})=\left(\chi ({z}_{{\rm{s}}})-\chi ({z}_{{\rm{l}}})\right)/(1+{z}_{{\rm{s}}})\), with proper comoving distance

We take *Ω*_{Λ} = 0.714 and *Ω*_{m} = 0.286, where *Ω*_{Λ} and *Ω*_{m} are the cosmic densities in dark energy and matter, respectively, with present-day Hubble constant *H*_{0} = 69.6 km s^{−1} Mpc^{−1}. The angular impact parameter *β* of the true position of the source to the lens can be parameterized in units of the Einstein radius, *y* ≡ *β*/*θ*_{E}. Such a configuration creates two images, with time delay given by

where

A source with angular impact parameter *β* has an effective lensing cross-section of

Thus, *y*_{min} and *y*_{max} turn the cross-section into an annulus. The minimum impact parameter is set by the time delay between the arrival times of the two images. If the time delay is too short, the images will appear as single γ-ray burst. For a point lens, we may calculate the minimum time delay for a lens of mass *M*_{l} at redshift *z*_{l} by inverting equation (30)

since *f*(*y*) is monotonic increasing in *y*. We take Δ*t*_{min} = 10 ms. The latter-arriving image is dimmer than the first image but must still be above the detectable flux for the detector, *μ*_{2}*φ*_{peak} > *φ*_{0}, where *μ*_{2} is the magnification of the dimmer image. This restricts the maximum possible impact parameter^{23}:

where *φ*_{peak}/*φ*_{0} is the peak counts divided by the trigger threshold at that time. We estimate *y*_{max} with medians of the *φ*_{peak}/*φ*_{0} for the peak flux on 64 ms, 256 ms and 1,024 ms integrations from the BATSE *C*_{max} table (https://go.nature.com/3qv0fDn), which are 1.5, 2.2 and 2.5, respectively. The final cross-section is then

where \({\bf{x}}\equiv ({M}_{{\rm{l}}},{z}_{{\rm{l}}},{z}_{{\rm{s}}},{\varphi }_{\text{peak}},{\varphi }_{0},{{\Delta }}{t}_{\text{min}})\) and *Θ* is the Heaviside step function.

The optical depth is the number density *n*(*z*_{l}) of lenses at redshift *z*_{l}, multiplied by the effective lensing cross-section of each lens *σ*(**x**), integrated over *z* ∈ (0, *z*_{s}):

We assume a constant comoving density of lenses

The number density of lenses can be related to their energy density *Ω*_{l} through

With comoving volume element

we have

With an estimated lens probability of *P*(*τ*) ≈ *τ* ≈ 3.7 × 10^{−4}, we infer the lens density by inversion of equation (40). The result of this integral is shown in Extended Data Fig. 9 for several mean source redshifts \(\langle{z}_{{\rm{s}}}\rangle\) each with the three permutations of *φ*_{peak}/*φ*_{0} from the BATSE *C*_{max} table.

The seven BATSE bursts with known redshifts are GRB 970508 with *z* = 0.835, GRB 970828 with *z* = 0.958, GRB 971214 with *z* = 3.412, GRB 980425 with *z* = 0.0085, GRB 980703 with *z* = 0.967, GRB 990123with *z* = 1.600 and GRB 990510 with *z* = 1.619, with mean \(\langle{z}\rangle\) = 1.34. The average spectroscopic redshift of Swift γ-ray bursts is \(\langle{z}\rangle\) = 2.2 (ref. ^{52}). We are unable to accurately estimate the redshift of GRB 950830 or the BATSE catalogue in general due to the inherent degeneracy between the effects of cosmological redshift and relativistic beaming on a γ-ray burst light curve. We argue that a mean BATSE GRB redshift of \(\langle{z}_{{\rm{s}}}\rangle\) ≈ 2 is appropriate based on the redshifts of known BATSE bursts and the spectroscopically determined redshifts of other GRB catalogues. We include the derived energy densities for a number of redshifts in Extended Data Fig. 10 for comparison. The lens densities are calculated from the source redshifts and optical depth through equation (40). With the inferred lens densities *Ω*_{l}, we may exclude our calculated globular cluster density *Ω*_{GC} ≈ 8 × 10^{−6} based on Poisson statistics. Observing one gravitational lens in ~2,679 light curves is very unlikely for such a low cosmological density.

The present-day number density is given by

where *ρ*_{c} is the critical energy density of the Universe and *M*_{IMBH}(*z*_{l}) is the mass of the lens. With \({{{\varOmega }}}_{{\rm{IMBH}}}(\langle{z}_{{\rm{s}}}\rangle \approx 2)=4.{6}_{-3.3}^{+9.8}\times 1{0}^{-4}\) and \((1+{z}_{{\rm{l}}}){M}_{{\rm{IMBH}}}=5.{5}_{-0.9}^{+1.7}\times 1{0}^{4}\ M_{\odot}\Rightarrow \, {M}_{{\rm{IMBH}}}({z}_{{\rm{l}}} \approx 1) \approx 2.{8}_{-0.9}^{+1.7}\times 1{0}^{4}\, M_{\odot}\) yields \({n}_{{\rm{IMBH}}}=2.{3}_{-1.6}^{+4.9}\times 1{0}^{3}\,{{\rm{Mpc}}}^{-3}\) through equation (38). Where *z*_{l} ≈ 1 comes from a gravitational lens being most likely to occur halfway between the observer and source. Uncertainty on the density of IMBHs arises from the fact that *N*_{lens} is Poisson distributed. We calculate the uncertainty on *n*_{l} assuming *z*_{l} = 0, as we do not know where the lens is, only that its most probable redshift is *z*_{l} ≈ 1. We ignore the uncertainty due to the lens mass as it is much more precisely determined. To calculate the uncertainty on *n*_{IMBH}, we assume that the likelihood of the data given *n*_{IMBH} follows an *N* = 1 Poisson distribution. Employing a Jeffreys’ prior

we obtain a 90% credible interval of *n*_{IMBH} = 0.7 × 10^{3}–7.2 × 10^{3} Mpc^{−3}.

### Magnification bias

It is possible that magnification bias may affect the estimate of the expected probability of lensing events. The possibility of magnification bias is discussed in ref. ^{23}, but the details are updated here from ref. ^{53}. For magnification bias to be greater than a few percent, the cumulative number counts d*N* of the physical parameter *P* by which the events are detected needs to have *α* > 2, where d*N* ∝ *P*^{−α}. In the case of GRBs, *P* is the peak flux over the trigger energy range. For BATSE, the number counts as a function of peak flux are given in Fig. 6^{53}. Estimating the value of *α* from these plots gives *α* ≈ 1.1. The trigger flux for GRB 950830 falls near the faint end of the distribution at 2.81 ± 0.12 photons cm^{−2} s^{−1} in the 50–300 keV energy range over integration times of 64 ms, 256 ms and 1,024 ms.

### The lens is unlikely to be a globular cluster

Let us assume that all globular clusters have the same mass as the discovered deflector. The globular cluster mass function has a turnover at ~2 × 10^{5} *M*_{⊙} (ref. ^{54}), so this approximation is not necessarily a bad one, especially given the uncertainty in the inferred lens mass. The Milky Way formed from an overdensity on a scale of approximately 20 Mpc^{3}. If the 200 globular clusters in the Milky Way is an average number count for a given cosmic volume, then the number density of globular clusters is approximately *n* ≈ 10 Mpc^{−3}. Thus with *n* ≈ 10 Mpc^{−3}, *M* ≈ 10^{5} *M*_{⊙}:

This is too low to be consistent with our inferred value of *Ω* ≈ 4 × 10^{−4}, suggesting that the lens is not a globular cluster. Assuming a mean source redshift of \(\langle{z}_{{\rm{s}}}\rangle \approx 2\) in the BATSE catalogue, we exclude a globular cluster lens at 99.85% credibility. See Extended Data Fig. 10 for exclusion credibilities for different mean redshifts. The mean of BATSE γ-ray bursts with known redshift \(\langle{z}\rangle\) = 1.34 gives an exclusion credibility of 99.97%, with *Ω*_{l} = 1.43 × 10^{−3}.

### Combining data from different channels

In the analysis presented above, we analyse each channel independently. This enables us to carry out posterior checks (Fig. 2) while controlling computational costs. However, to estimate the significance of the lensing signal, we combine the results from each channel together, increasing the resolving power to obtain a single BF for the lensing versus no-lensing hypotheses. There are several steps. First, we take the posterior samples used to calculate the credible intervals for delay time Δ*t* and magnification ratio *r* in Fig. 2 and use a kernel density estimator to obtain an analytic description of the posterior distribution for each channel *i*:

This step is necessary to obtain smooth functions that can be multiplied together. Next, we invoke Bayes’ theorem to convert the kernel density estimators to likelihoods distributions for each channel:

If the two pulses are created by a lens, then the delay time Δ*t* and magnification ratio *r* are the same for each channel. Thus, the total evidence for the lensing hypothesis is given by the product of likelihoods for each data channel, marginalized over (Δ*t*, *r*):

In contrast, if the two pulses are not created from a lens, there is no reason for the delay time and magnification ratio to be the same for each channel, and so the total evidence for the null hypothesis is given simply by the product of the evidence values for each channel:

Evaluating equations (45) and (47), we obtain a total ln(BF) = 12.93 in favour of the lensing hypothesis.

### False alarm probability

In Bayesian statistics, we carry out model selection using the posterior odds^{26}

where \({{\mathcal{Z}}}_{\text{lens}}/{{\mathcal{Z}}}_{\text{null}}=\text{BF}\,\) is the BF from equation (26). The prior odds, *π*_{lens}/*π*_{null}, expresses the relative probability assigned a priori to the hypothesis of lensing over a null model. If we assign an equal prior probability to both hypotheses, then

and so the false alarm probability is

A more conservative approach is to assign prior odds equal to the reciprocal of the total number of bursts searched (or equivalently, equal to the optical depth), which gives us:

which gives a false alarm probability of

We see that the strong preference for the lensing hypothesis persists even taking into account trial factors.

### A rejected candidate

For illustrative purposes, we also include one gravitational lensing candidate identified by the autocorrelation algorithm, which our Bayesian framework strongly rejects. The light curve for GRB 911031 is shown in Extended Data Fig. 7 as the sum of the four BATSE large-area detector broadband energy channels and separately for each channel in the first and third panels, respectively. Each colour indicates a different energy channel: red. 20–60 keV; yellow, 60–110 keV; green, 110–320 keV; blue, 320–2,000 keV. The light curve has the sort of repeating pulse structure that one might naively mistake for lensing. The time delay is even similar in each energy channel. The second and fourth panels show the correlogram (autocorrelation) of the summed and spectral light curves respectively.

The results of autocorrelation indicate very strongly that there is some similar structure in the two pulses. However, the pulse modelling prefers a two-pulse model in every channel because the two pulses are not precise duplicates. Not only are the pulse shapes (*τ*, *ξ*) different between the two pulses but also the time delays and magnification ratios (Δ*t*, *r*) inferred through parameter estimation are inconsistent. Extended Data Fig. 8 shows the gravitational lens parameter posterior distributions for lens model fit to GRB 911031. Gravitational lensing for point sources is achromatic, so the time delay and magnification ratio posteriors for each channel should be overlapping for a gravitational lensing candidate. The clear correlation between energy, magnification and time delay immediately suggests that these are two independent pulses of a GRB and not a gravitational lensing echo. The ln(BF) values in favour of a two-pulse model are 229.0, 301.7, 374.0 and 15.4 for channels 1, 2, 3 and and 4, respectively. We can therefore firmly rule out the lensing interpretation for this burst.

## Data availability

The BATSE data catalogue is available from the NASA data archive at https://heasarc.gsfc.nasa.gov/FTP/compton/data/batse/trigger. We use the ‘discsc’, ‘tte’ and ‘tte_list’ datatypes in our search. The data used in our analysis of GRB 950830 can be found at https://heasarc.gsfc.nasa.gov/FTP/compton/data/batse/trigger/03601_03800/03770_burst/tte_bfits_3770.fits.gz and https://heasarc.gsfc.nasa.gov/FTP/compton/data/batse/trigger/03601_03800/03770_burst/tte_list_3770.fits.gz. Source data are provided with this paper.

## Code availability

The analysis code PyGRB^{55} has been written in Python^{56} by J.P. and is freely available at https://github.com/JamesPaynter/PyGRB under the BSD 3-Clause License. PyGRB is built around Monash University’s Bilby nested sampling wrapper, with additional FITS I/O functionality provided by AstroPy^{57}. The software uses the NumPy^{58} and SciPy^{59} computational libraries. Plotting makes use of the Matplotlib^{60} and corner^{61} libraries^{62}.

## References

- 1.
Paczynski, B. Gamma-ray bursters at cosmological distances.

*Astrophys. J. Lett.***308**, L43–L46 (1986). - 2.
Paczynski, B. Gravitational microlensing and gamma-ray bursts.

*Astrophys. J. Lett.***317**, L51–L55 (1987). - 3.
Wambsganss, J. A method to distinguish two gamma-ray bursts with similar time profiles.

*Astrophys. J.***406**, 29–35 (1993). - 4.
Nowak, M. A. & Grossman, S. A. Can we identify lensed gamma-ray bursts?

*Astrophys. J.***435**, 557–572 (1994). - 5.
Muñoz, J. B., Kovetz, E. D., Dai, L. & Kamionkowski, M. Lensing of fast radio bursts as a probe of compact dark matter.

*Phys. Rev. Lett.***117**, 091301 (2016). - 6.
Ji, L., Kovetz, E. D. & Kamionkowski, M. Strong lensing of gamma ray bursts as a probe of compact dark matter.

*Phys. Rev. D***98**, 123523 (2018). - 7.
Hirose, Y., Umemura, M., Yonehara, A. & Sato, J. Imprint of gravitational lensing by population III stars in gamma-ray burst light curves.

*Astrophys. J.***650**, 252–260 (2006). - 8.
Portegies Zwart, S. F., Baumgardt, H., Hut, P., Makino, J. & McMillan, S. L. W. Formation of massive black holes through runaway collisions in dense young star clusters.

*Nature***428**, 724–726 (2004). - 9.
Aasi, J. et al. Advanced LIGO.

*Class. Quantum Grav.***32**, 074001 (2015). - 10.
Acernese, F. et al. Advanced Virgo: a 2nd generation interferometric gravitational wave detector.

*Class. Quantum Grav.***32**, 024001 (2015). - 11.
Abbott, B. P. et al. Binary black hole population properties inferred from the first and second observing runs of advanced LIGO and advanced Virgo.

*Astrophys. J.***882**, L24 (2019). - 12.
Abbott, B. P. et al. GW190521: a binary black hole merger with a total mass of 150

*M*_{⨀}.*Phys. Rev. Lett.***125**, 101102 (2020). - 13.
King, A. GSN 069—a tidal disruption near miss.

*Mon. Not. R. Astron. Soc.***493**, L120–L123 (2020). - 14.
Oka, T., Tsujimoto, S., Iwata, Y., Nomura, M. & Takekawa, S. Millimetre-wave emission from an intermediate-mass black hole candidate in the Milky Way.

*Nat. Astron.***1**, 709–712 (2017). - 15.
Takekawa, S., Oka, T., Iwata, Y., Tsujimoto, S. & Nomura, M. The fifth candidate for an intermediate-mass black hole in the Galactic Center.

*Astrophys. J.***890**, 167 (2020). - 16.
Lin, D. et al. A luminous X-ray outburst from an intermediate-mass black hole in an off-centre star cluster.

*Nat. Astron.***2**, 656–661 (2018). - 17.
Press, W. H. & Gunn, J. E. Method for detecting a cosmological density of condensed objects.

*Astrophys. J.***185**, 397–412 (1973). - 18.
Fishman, G. J., Meegan, C. A., Wilson, R. B., Paciesas, W. S. & Pendleton, G. N. The BATSE experiment on the Compton Gamma Ray Observatory: status and some early results. In

*NASA Conference Publication*Vol. 3137, 26–34 (NASA, 1992). - 19.
Costa, E. et al. Discovery of an X-ray afterglow associated with the γ-ray burst of 28 February 1997.

*Nature***387**, 783–785 (1997). - 20.
Narayan, R. & Wallington, S. Determination of lens parameters from gravitationally lensed gamma-ray bursts.

*Astrophys. J.***399**, 368–372 (1992). - 21.
Mao, S. Gravitational lensing, time delay, and gamma-ray bursts.

*Astrophys. J. Lett.***389**, L41–L44 (1992). - 22.
Krauss, L. M. & Small, T. A. A new approach to gravitational microlensing—time delays and the galactic mass distribution.

*Astrophys. J.***378**, 22–29 (1991). - 23.
Blaes, O. M. & Webster, R. L. Using gamma-ray bursts to detect a cosmological density of compact objects.

*Astrophys. J. Lett.***391**, L63–L66 (1992). - 24.
Geiger, B. & Schneider, P. The light-curve reconstruction method for measuring the time delay of gravitational lens systems.

*Mon. Not. R. Astron. Soc.***282**, 530–546 (1996). - 25.
Norris, J. P. et al. Attributes of pulses in long bright gamma-ray bursts.

*Astrophys. J.***459**, 393–412 (1996). - 26.
Thrane, E. & Talbot, C. An introduction to Bayesian inference in gravitational-wave astronomy: parameter estimation, model selection, and hierarchical models.

*Pub. Astron. Soc. Aust.***36**, E010 (2019). - 27.
Baumgardt, H. & Hilker, M. A catalogue of masses, structural parameters, and velocity dispersion profiles of 112 Milky Way globular clusters.

*Mon. Not. R. Astron. Soc.***478**, 1520–1557 (2018). - 28.
Elbert, O. D., Bullock, J. S. & Kaplinghat, M. Counting black holes: the cosmic stellar remnant population and implications for LIGO.

*Mon. Not. R. Astron. Soc.***473**, 1186–1194 (2018). - 29.
Hurley, K. et al. A search for gravitationally lensed gamma-ray bursts in the data of the interplanetary network and konus-wind.

*Astrophys. J.***871**, 121 (2019). - 30.
Marani, G. F., Nemiroff, R. J., Norris, J. P., Hurley, K. & Bonnell, J. T. Gravitationally lensed gamma-ray bursts as probes of dark compact objects.

*Astrophys. J. Lett.***512**, L13–L16 (1999). - 31.
Williams, L. L. R. & Wijers, R. A. M. J. Distortion of gamma-ray burst light curves by gravitational microlensing.

*Mon. Not. R. Astron. Soc.***286**, L11–L16 (1997). - 32.
Wyithe, J. S. B. & Turner, E. L. Gravitational microlensing of gamma-ray bursts at medium optical depth.

*Mon. Not. R. Astron. Soc.***319**, 1163–1168 (2000). - 33.
Lewis, G. F. Gravitational microlensing time delays at high optical depth: image parities and the temporal properties of fast radio bursts.

*Mon. Not. R. Astron. Soc.***497**, 1583–1589 (2020). - 34.
Walker, M. A. & Lewis, G. F. Nanolensing of gamma-ray bursts.

*Astrophys. J.***589**, 844–860 (2003). - 35.
Gould, A. Femtolensing of gamma-ray bursters.

*Astrophys. J. Lett.***386**, L5–L7 (1992). - 36.
Nemiroff, R. J. et al. Searching gamma-ray bursts for gravitational lensing echoes—implications for compact dark matter.

*Astrophys. J.***414**, 36–40 (1993). - 37.
Ougolnikov., O. S. A search for possible mesolensing of cosmic gamma-ray bursts: II. Double and triple bursts in the BATSE catalog.

*Cosmic Res.***41**, 141–146 (2003). - 38.
Biltzinger, B., Kunzweiler, F., Greiner, J., Toelge, K. & MichaelBurgess, J. A physical background model for the Fermi Gamma-ray Burst Monitor.

*Astron. Astrophys.***640**, A8 (2020). - 39.
Nemiroff, R. J. et al. Gamma-ray burst lensing limits on cosmological parameters.

*AIP Conf. Proc.***526**, 663 (2000). - 40.
Li, C. & Li, L. Search for strong gravitational lensing effect in the current GRB data of BATSE.

*Sci. Chin. Phys. Mech. Astron.***57**, 1592–1599 (2014). - 41.
Davidson, R., Bhat, P. N. & Li, G. Are there gravitationally lensed gamma-ray bursts detected by GBM?

*AIP Conf. Proc.***1358**, 17 (2011). - 42.
Bagoly, Z. & Veres, P. Achromatic search for gravitational lensing in Fermi data.

*AIP Conf. Proc.***1279**, 293 (2010). - 43.
Oguri, M. Strong gravitational lensing of explosive transients.

*Rep. Prog. Phys.***82**, 126901 (2019). - 44.
Hakkila, J., Horváth, I., Hofesmann, E. & Lesage, S. Properties of short gamma-ray burst pulses from a BATSE TTE GRB pulse catalog.

*Astrophys. J.***855**, 101 (2018). - 45.
Ashton, G. et al. Bilby: a user-friendly bayesian inference library for gravitational-wave astronomy.

*Astrophys. J. Suppl. Ser.***241**, 27 (2019). - 46.
Skilling, J. Nested sampling.

*AIP Conf. Proc.***735**, 395 (2004). - 47.
Skilling, J. Nested sampling for general Bayesian computation.

*Bayesian Anal.***1**, 833–859 (2006). - 48.
Feroz, F., Hobson, M. P. & Bridges, M. MULTINEST: an efficient and robust Bayesian inference tool for cosmology and particle physics.

*Mon. Not. R. Astron. Soc.***398**, 1601–1614 (2009). - 49.
Higson, E., Handley, W., Hobson, M. & Lasenby, A. Dynamic nested sampling: an improved algorithm for parameter estimation and evidence calculation.

*Stat. Comput.***29**, 891–913 (2019). - 50.
Speagle, J. S. DYNESTY: a dynamic nested sampling package for estimating Bayesian posteriors and evidences.

*Mon. Not. R. Astron. Soc.***493**, 3132–3158 (2020). - 51.
Band, D. et al. BATSE observations of gamma-ray burst spectra. I. Spectral diversity.

*Astrophys. J.***413**, 281–292 (1993). - 52.
Xiao, L. & Schaefer, B. E. Redshift catalog for Swift long gamma-ray bursts.

*Astrophys. J.***731**, 103 (2011). - 53.
Paciesas, W. S. et al. The fourth BATSE gamma-ray burst catalog (revised).

*Astrophys. J. Suppl.***122**, 465–495 (1999). - 54.
Jordán, A. et al. The ACS Virgo Cluster Survey. XII. The luminosity function of globular clusters in early-type galaxies.

*Astrophys. J. Suppl.***171**, 101–145 (2007). - 55.
Paynter, J. R. Pygrb: a pure Python gamma-ray burst analysis package.

*J. Open Source Softw.***5**, 2536 (2020). - 56.
Van Rossum, G. & Drake, F. L.

*Python 3 Reference Manual*(CreateSpace, 2009). - 57.
Collaboration, A. et al. Astropy: a community Python package for astronomy.

*Astron. Astrophys.***558**, A33 (2013). - 58.
van der Walt, S., Colbert, S. C. & Varoquaux, G. The numpy array: a structure for efficient numerical computation.

*Comput. Sci. Eng.***13**, 22–30 (2011). - 59.
Virtanen, P. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python.

*Nat. Methods***17**, 261–272 (2020). - 60.
Hunter., J. D. Matplotlib: a 2D graphics environment.

*Comput. Sci. Eng.***9**, 90–95 (2007). - 61.
Foreman-Mackey, D. corner.py: scatterplot matrices in Python.

*J. Open Source Softw.***1**, 24 (2016). - 62.
Meade, B., Lafayette, L., Sauter, G. & Tosello, D.

*Spartan HPC-Cloud Hybrid: Delivering Performance and Flexibility*(Univ. Melbourne, 2017); https://doi.org/10.4225/49/58ead90dceaaa

## Acknowledgements

E.T. is supported through Australian Research Council grant no. CE170100004 and no. FT150100281. The analysis software was run on The University of Melbourne’s Spartan HPC system. This research has made use of data provided by the High Energy Astrophysics Science Archive Research Center (HEASARC), which is a service of the Astrophysics Science Division at NASA/GSFC and the High Energy Astrophysics Division of the Smithsonian Astrophysical Observatory. J.P. acknowledges S. Wyithe, M. Trenti and A. Melatos for constructive comments in analysing and interpreting the data and results. J.P. also thanks C. Shrader for assistance in understanding the BATSE instrumentation, and J. M. Burgess for constructive feedback on PyGRB and the proper analysis of gamma-ray data.

## Author information

### Affiliations

### Contributions

R.W. contributed to the initial planning of the project with later additions from J.P. and E.T. J.P. contributed the data analysis through the pulse-fitting software package PyGRB under the guidance of E.T. The manuscript was drafted by J.P. and E.T. J.P. and R.W. contributed the gravitational lensing calculations while E.T. contributed the Bayesian framework. J.P. and E.T. responded to questions and comments from the referees. All authors discussed the results and commented on the manuscript.

### Corresponding authors

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Additional information

**Peer review information** *Nature Astronomy* thanks Zsolt Bagoly, Kevin Hurley, Masamune Oguri and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.

**Publisher’s note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Extended data

### Extended Data Fig. 1 The individual pulses that make up channel 1 (red: 20-60 keV) of Figure 2.

**a**, The solid red lines are the median of 60,000 FRED-X pulses sampled from the posterior distributions. 200 of these curves are sampled and shown in black. **b**, The same as a) for the sine-Gaussian residual. **c**, The sum of the medians of the pulses in a and b.
Source data

### Extended Data Fig. 2 The individual pulses that make up channel 2 (yellow: 60-110 keV) of Figure 2.

**a**, The solid yellow lines are the median of ~ 60, 000 FRED-X pulses sampled from the posterior distributions. 200 of these curves are sampled and shown in black. **b**, The same as **a**) for the sine-Gaussian residual. **c**, The sum of the medians of the pulses in a and b.
Source data

### Extended Data Fig. 3 The individual pulses that make up channel 2 (green: 110-320 keV) of Figure 2.

**a**, The solid green lines are the median of ~ 60, 000 FRED-X pulses sampled from the posterior distributions. 200 of these curves are sampled and shown in black. **b**, The same as **a**) for the sine-Gaussian residual. **c**, The sum of the medians of the pulses in a and b.
Source data

### Extended Data Fig. 4 The individual pulses that make up channel 2 (blue: 320-2,000 keV) of Figure 2.

**a**, The solid blue lines are the median of ~ 60,000 FRED-X pulses sampled from the posterior distributions. 200 of these curves are sampled and shown in black. **b**, The same as **a**) for the sine-Gaussian residual. **c**, The sum of the medians of the pulses in a and b.
Source data

### Extended Data Fig. 5 The Hardness-Duration plot of BATSE GRBs.

The T90 durations are taken from the BATSE data tables: https://gammaray.nsstc.nasa.gov/batse/grb/catalog/4b/index.html. We calculate the hardness ratios for each of the GRBs with a listed T90. The short *γ*-ray burst population is shown in purple, and the long GRB population in red. Iso-likelihood contours of a two-component Gaussian mixture model are plotted in grey. The plotted uncertainties in the hardness ratio are defined by 1- *σ* statistical errors on the number of counts in the numerator and denominator.
Source data

### Extended Data Fig. 6 The autocorrelation of the light curve of GRB 950830.

**a**, The sum of the four energy channels, ~ 20-2,000 keV. **b**, The autocorrelation function of the summed light curve, where the autocorrelation is defined in equation (6). The black dotted line is a fit to the light curve with a 3rd order Savitzky-Golay smoothing filter with a 101 bin smoothing window. The vertical red dotted line is the point of maximum deviation between the ACF and the Savitzky-Golay smoothing filter at *δ**t*= 0.390 seconds. The blue shaded regions delineate regions of 1 − *σ*, 3 − *σ*, and 5 − *σ* away from the Savitzky-Golay fit. The dispersion between the autocorrelation function and the fit, *σ*^{2}, is defined in equation (7). **c**, The autocorrelation function for each of the 4 BATSE large area detector broadband energy channels. Each colour indicates a different energy channel, red: 20-60 keV, yellow: 60-110 keV, green: 110-320 keV, blue: 320-2,000 keV. The shaded regions delineate 3-*σ* deviance from the Savitzky-Golay fits, which are omitted for clarity.
Source data

### Extended Data Fig. 7 The autocorrelation of the light curve of GRB 911031.

**a**, The sum of the four energy channels, 20-2,000 MeV. **b**, The autocorrelation function of the summed light curve, where the autocorrelation is defined in equation (6). The dotted line is a fit to the light curve with a 3rd order Savitzky-Golay smoothing filter with a 101 bin smoothing window. The blue shaded regions delineate regions of 1 − *σ*, 3 − *σ*, and 5 − *σ* away from the Savitzky-Golay fit. The dispersion between the autocorrelation function and the fit, *σ*^{2}, is defined in equation (7). **c**, The light curve for each of the 4 BATSE large area detector broadband energy channels. Each colour indicates a different energy channel, red: 20-60 keV, yellow: 60-110 keV, green: 110-320 keV, blue: 320-2,000 keV. **d**, The autocorrelation function for each light curve channel. The shaded regions delineate 3 − *σ* deviance from the Savitzky-Golay fits, which are omitted for clarity.
Source data

### Extended Data Fig. 8 The gravitational lens parameter posterior distributions for a model fit to GRB 911031 for each of the 4 BATSE large area detector broadband energy channels.

Each colour indicates a different energy channel, red: 20-60 keV, yellow: 60-110 keV, green: 110-320 keV, blue: 320-2,000 keV. Contours contain 39.3%. 86.4%, and 98.9% of the probability density. The light curve of GRB 911031 is shown in Extended Data Fig. 7. Source data

### Extended Data Fig. 9 Optical depth as a function of source redshift *z*_{s}.

We estimate the optical depth for mean source redshifts z_{s}=0.1: blue, z_{s}: orange, z_{s}=1.0: green, z_{s}=1.34: black, z_{s}=2.0: red, z_{s}=5.0: purple based on Eq. (38). The median Cmax/Cmin values of 1.5, 2.2, and 2.5 taken as the magnification limit cutoff (Eq.(32)) are shown as solid, dash-dot, and dashed curves respectively. The solid black horizontal line is the estimate lens probability based on seeing one event in 2,679 light curves. The dotted black vertical line is the estimated globular cluster density, Ω_{gc}. The dash-dot vertical black line is the naive estimate for the density Ω_{lens} ~ *τ*. The calculated lens densities for each redshift are summarized in Extended Data Fig. 10.
Source data

### Extended Data Fig. 10 The inferred lens densities Ω_{l} for mean source redshift *z*_{s}.

A median peak counts ratio \(\tilde{C}=2.5\) from the BATSE \({{\rm{C}}}_{\max }/{{\rm{C}}}_{\min }\) table for 1,024ms integration times is assumed. The peak count ratios are defined through \({\rm{C}}\equiv {{\rm{C}}}_{\max }/{{\rm{C}}}_{\min }\). \({{\rm{C}}}_{\max }\) is the maximum detected counts over a given integration period. \({{\rm{C}}}_{\min }\) is the minimum number of counts that would trigger the second most brightly illuminated detector at that time. Further details are given in the Methods section calculation of optical depths.

## Source data

### Source Data Fig. 1

Light curve of GRB 950830 with fits.

### Source Data Fig. 2

Four overlapping coloured circles and a black circle. Time delay and magnification ratio posteriors for GRB 950830.

### Source Data Fig. 3

Coloured probability densities.

### Source Data Extended Data Fig. 1

Red lines.

### Source Data Extended Data Fig. 2

Yellow lines.

### Source Data Extended Data Fig. 3

Green lines.

### Source Data Extended Data Fig. 4

Blue lines.

### Source Data Extended Data Fig. 5

Hardness duration plot.

### Source Data Extended Data Fig. 6

Three-panel autocorrelation of GRB 950830.

### Source Data Extended Data Fig. 7

Four-panel autocorrelation of GRB 911031.

### Source Data Extended Data Fig. 8

Four colinear coloured circles. Magnification ratio and time delay posterior GRB 911031.

### Source Data Extended Data Fig. 9

Lens probability graph.

## Rights and permissions

## About this article

### Cite this article

Paynter, J., Webster, R. & Thrane, E. Evidence for an intermediate-mass black hole from a gravitationally lensed gamma-ray burst.
*Nat Astron* (2021). https://doi.org/10.1038/s41550-021-01307-1

Received:

Accepted:

Published: