Bayesian model selection for GRB 211211A through multi-wavelength analyses

Although GRB 211211A is one of the closest gamma-ray bursts (GRBs), its classification is challenging because of its partially inconclusive electromagnetic signatures. In this paper, we investigate four different astrophysical scenarios as possible progenitors for GRB~211211A: a binary neutron-star merger, a black-hole--neutron-star merger, a core-collapse supernova, and an r-process enriched core collapse of a rapidly rotating massive star (a collapsar). We perform a large set of Bayesian multi-wavelength analyses based on different models describing these scenarios and priors to investigate which astrophysical scenarios and processes might be related to GRB~211211A. Our analysis supports previous studies in which the presence of an additional component, likely related to $r$-process nucleosynthesis, is required to explain the observed light curves of GRB~211211A, as it can not solely be explained as a GRB afterglow. Fixing the distance to about $350~\rm Mpc$, namely the distance of the possible host galaxy SDSS J140910.47+275320.8, we find a statistical preference for a binary neutron-star merger scenario.


INTRODUCTION
The joint detection of gravitational waves (GWs) and electromagnetic (EM) signatures originating from the merger of binary neutron stars (BNSs) on August 17th 2017 (Abbott et al. 2017;Abbott et al. 2017) was a breakthrough in multimessenger astronomy.In addition to the GW signal GW170817, an associated kilonova, AT2017gfo, and a gamma-ray burst (GRB), GRB 170817A, were observed (Abbott et al. 2017).This multimessenger detection allowed for an independent way of measuring the expansion rate of the Universe Abbott et al. (2017), placed new constraints on the properties of supranuclear-dense matter (Bauswein et al. 2017;Ruiz et al. 2018;Radice et al. 2018;Most et al. 2018;Coughlin et al. 2019;Capano et al. 2020;Dietrich et al. 2020;Huth et al. 2022), and proved that at least some short GRBs are connected to compact binary mergers (Abbott et al. 2017).However, it was also reported that short GRBs could originate from collapsars (Ahumada et al. 2021), indicating that the classification of astrophysical scenarios associated with GRBs is more complex (Zhang et al. (2021); Rossi et al. (2022)).Additional signatures associated with GRBs and their afterglows, such as kilonovae, help significantly in the identification of the origin of the progenitors.The kilonova AT2017gfo was certainly an ex-emplary case for such an EM signal, and spectral features connected to the creation of new elements (Watson et al. 2019;Domoto et al. 2022) in the outflowing material have possibly been observed.In addition to AT2017gfo, there are a large number of kilonova candidates that could be connected to other GRB observations, e.g., GRB 060614, GRB 130603B, GRB 150101B, GRB 150424A, GRB 160821B, GRB 060505 e.g., Tanvir et al. (2013); Berger et al. (2013); Yang et al. (2015); Jin et al. (2015); Fong et al. (2016); Troja et al. (2018); Lamb et al. (2019); Kasliwal et al. (2017); Jin et al. (2018); Troja et al. (2019); Jin et al. (2020); cf.e.g.Ascenzi et al. (2019) for a review about some of these kilonova candidates.The most recent example that has to be added to the list is the kilonova candidate associated with GRB 211211A.
This GRB signal was discovered on the 11th December 2021 at 13:09:59 (UT) with the Burst Alert Telescope (BAT) of the Swift Observatory, with its optical and near-infrared counterpart observed by, for example, Rastinejad et al. (2022) and Troja et al. (2022).
This GRB signal is characterized by a complex emission phase lasting approximately 50 s and shows several overlapping pulses lasting for about ∼ 12 s (Rastinejad et al. ( 2022)).Given this duration, GRB 211211A would be classified as a long GRB typically arising from the core-collapse of a massive star (e.g., Stanek et al. 2003;Levan et al. 2016) and not from compact binary mergers.Hence, for a scenario such as GRB 211211A, one would not necessarily expect to observe an associated kilonova.Based on intensive follow-up observations (Rastinejad et al. 2022;Troja et al. 2022), it seems plausible that SDSS J140910.47+275320.8 was the host galaxy of GRB 211211A, at 98.6 percent confidence (Rastinejad et al. 2022).
Numerous groups, e.g., (Rastinejad et al. 2022;Troja et al. 2022;Yang et al. 2022;Mei et al. 2022), and also other groups explained these observations by invoking a kilonova in associated with GRB 211211A.This was suggested for various reasons: (i) the profile of the prompt emission showed an initially complex structure followed by an extended softer emission, (ii) a predominant signature of a supernova was lacking for up to 17 days post-discovery, (iii) the color evolution of the optical counterpart had similar properties as AT2017gfo, and (iv) the offset of the GRB location concerning the center of the host galaxy was larger than for typical long GRBs.
The origin of GRB 211211A is hotly debated: Yang et al. (2022), for example, suggested that it has similar properties as GRB 060614, another event associated with a kilonova candidate.They conclude that the sig-nificant excess in the near-infrared and optical afterglow at late observations points more towards a neutron starwhite dwarf merger that leaves behind a rapidly spinning magnetar as a central engine providing additional heating to the ejecta.Suvorov et al. (2022) mentioned a possible gamma-ray precursor before the main emission, which was caused by the resonant shattering of one star's crust prior to the merger.In contrast, Gao et al. (2022) argued for the presence of a strong magnetic field from the precursor surrounding the central engine of the GRB.This would result in the prolongation of the accretion process and, thus, could explain the duration of the hard spiky emission detected for GRB 211211A.Similarly, Xiao et al. (2022) supposes that a magnetar participated in the merger and caused a quasi-periodic precursor.Gompertz et al. (2023) analysed the spectra of the prompt emission of GRB 211211A by using synchrotron spectrum models and concluded that the rapid evolution of synchrotron emission was the main driver its extended emission.While the kilonova observed for GRB 211211A argues for a BNS merger, a neutronstar-black-hole (NSBH) scenario cannot be fully ruled out.Finally, Barnes & Metzger (2023) investigated the possibility that collapsars could explain the origin of GRB 211211A and found that the afterglow-subtracted emission of GRB 211211A is in best agreement for collapsar models with high kinetic energies.
Following the discussion in the literature, we will use our nuclear physics and multimessenger astrophysics (NMMA) framework (Pang et al. 2022) 1 to explore various astrophysical scenarios for the origin of GRB 211211A.We will consider the possibility of two merger scenarios, a BNS merger and an NSBH merger, and in addition two supernova scenarios, a core-collapse supernova, and an r-process enriched collapsar.At this point, we emphasize that while multiple scenarios (e.g.different supernova types) could possibly explain the origin of GRB 211211A, we restrict our study to the four scenarios mentioned above, and to particular models representing such scenarios.Hence, our study will only provide estimates for this narrow parameter space of possible scenarios.For our model selection study, the NMMA framework allows us to simultaneously fit the observed data across the full electromagnetic range with multiple models; for example, we can simultaneously employ GRB afterglow and kilonova models without the need to split the observational data in chunks and processing them separately.

OBSERVATIONAL DATA
In order to perform our model selection, we collect a set of multi-wavelength data observed for GRB 211211A.However, we do not use any data from the prompt emission phase of the GRB in our analysis because our framework is, at the current stage, not able to handle such highly energetic emission.
With regard to the X-ray data, we use the available information from the Swift X-ray Telescope.In particular, we use the 0.3 -10 keV flux light curve observed at late times (t = 10 4 s after BAT trigger time) and convert it to 1-keV flux densities following Gehrels et al. (2008).For our optical study in UV, we use results from Swift-UVOT in table 2 provided by Rastinejad et al. (2022) in the bands v, b, u, uvw1, uvm2, uvw2, and white.To supplement these UVOT data, we incorporate measurements from "supplement Table 1" provided by Troja et al. (2022).Whenever measurements overlap within a 30-min window in the same band between Troja et al. (2022) and Rastinejad et al. (2022), we remove duplicates, as such measurements represent variations in analysis binning during the early epoch between the two publications. 2For the remaining optical data, we exclusively utilize measurements directly analysed by Rastinejad et al. (2022) (cf.table 1 in the appendix, references 1).We follow a similar approach for the published data from Troja et al. (2022).(cf.supplement table 1).Furthermore, we augment our data set with measurements exclusively published in the General Coordinates Network (GCNs) (Pankov et al. 2021;Mao et al. 2021) for instance.In this manner, we try to obtain an almost complete set encompassing available optical data for this particular GRB, including the latest publicly accessible measurements when possible.The data were all corrected from the foreground Galactic extinction A V = 0.048 mag (Schlafly & Finkbeiner 2011).
Furthermore, we use the 6 GHz radio detection of GRB 211211A observed 6.27 d after the initial trigger with a 5σ upper limit flux density of 16 µJy (Rastinejad et al. 2022).With regard to available GeV data, as reported in Zhang et al. (2022) and Mei et al. (2022), we do not include this data because our employed GRB model does not provide mechanisms to explain their origin.

Bayesian Inference
Our analysis is based on the nuclear physics and multimessenger astronomy framework NMMA (Pang et al. 2022) that allows us to perform joint Bayesian inference runs of multimessenger events containing GWs, kilonovae, supernovae, and GRB afterglow signatures.For this paper, we extended the code infrastructure to include the description of r-process enriched collapsars following the model of Barnes & Metzger (2022).
We use the EM data of GRB 211211A to investigate which model or which combination of models describe the observational data best.According to Bayes' theorem, we compute posterior probability distributions, p(θ|d, M ), for model source parameters θ under the hypothesis or model M with data d as (1) where P(θ), L(θ), π(θ), and Z(d) are the posterior, likelihood, prior, and evidence, respectively.In order to investigate the plausibility of competing models, we evaluate the odds ratio O 1 2 for two models M 1 and M 2 which is given by where B 1 2 and Π 1 2 are the Bayes factor and the prior odds, respectively.Under the assumption that the different astrophysical scenarios considered here are equally likely to explain GRB 211211A, we impose unity prior odds, namely Π 1 2 = 1, for all comparisons of models describing these scenarios.Therefore, we simply compute the Bayes factor B 1 2 .In our study, we report the natural logarithm of the Bayes factor, relative to our best fitting model as a reference (ref. ), which we will denote as ln B ref hereafter.Following Jeffreys (1961) and Kass & Raftery (1995), we interpret ln B 1 ref as the evidence favoring our reference model as: ref ] ≤ 0 no strong evidence.However, we point out that these classifications should only be considered as estimates and that the Bayes factor is generally a continuous quantity.In addition to the Bayes factor, we also provide information about the ratio of the maximum likelihood, or the difference of the maximum log-likelihood point estimates ln[L 1 2 ( θ)] supporting our analysis in Sec.4.1.We will denote this as ln[L ref ( θ)] when we compare the maximum log-likelihood against our reference model.

Employed models
As described in the Introduction, we investigate four different scenarios in our study from which GRB 211211A could have emerged.In particular, we consider two merger scenarios: a BNS merger and an NSBH merger, and two supernova cases, namely a phenomenological long GRB supernova template and an rprocess enriched collapsar scenario.As a word of caution, we emphasize that all these scenarios can only be considered when employing characteristic models describing such a scenario.
Strictly speaking, our results will only favor or disfavor particular models employed for the analysis, but we will not be able to rule out an entire astrophysical scenario; for example, disfavoring the employed SN98bw and rCCSNe will not be sufficient to rule out the supernova origin completely.
BNS scenario: For this case, we use the kilonova models of Dietrich et al. (2020) (hereafter 'BNS-KN-Bulla') and of Kasen et al. (2017) (hereafter 'BNS-KN-Kasen').BNS-KN-Bulla is based on the time-dependent 3D Monte Carlo radiation transfer code possis (Bulla (2019(Bulla ( , 2023))), which computes light curves, spectra, and luminosities for kilonovae depending on the viewingangle θ Obs .The ejected material is classified through the dynamical ejecta mass, M dyn ej , and the disc-wind ejecta mass, M wind ej .The tidal dynamical ejecta component is assumed to be distributed within a half-opening angle Φ.In the same way, BNS-KN-Kasen uses the multidimensional Monte Carlo code sedona, which solves the multiwavelength radiation transport equation in a relativistically expanding medium (Kasen et al. (2006); Roth & Kasen (2015)).In this paper, we use the 1D model provided by Kasen et al. (2017), which assumes spherical symmetry and uniform composition for our analysis.The model, 'BNS-KN-Kasen', depends on the ejecta mass, M ej , a characteristic expansion velocity, v ej , and the mass fraction of lanthanides, X lan , which affects the opacity.
NSBH scenario: For this case, we also use a possis model grid of kilonova spectra tailored to NSBH mergers which was used in the study of Anand et al. (2021) (hereafter 'NSBH-KN-Bulla').This model depends on the same model parameters as BNS-KN-Bulla but excludes the dependence on the half opening angle of the dynamical ejecta, fixed to Φ = 30 • .Supernova: In order to assess the possibility of a typical core-collapse supernova (CCSN) associated with a long GRB, we use the nugent-hyper model from sncosmo (Levan et al. 2005) with the absolute magnitude, S max , as the main free parameter.This model is a template constructed from observations of the supernova SN1998bw associated with the long GRB 980425 and is hereafter abbreviated as 'SN98bw'.
r-process enriched Collapsar: Rapidly rotating massive star core collapses (Burbidge et al. 1957;Qian & Woosley 1996) are another possible astrophysical site for r-process nucleosynthesis.As massive stars undergo a core collapse, material is disrupted and forms an accretion disk which can become neutron-rich through weak interactions (Beloborodov 2003), and can launch winds that power emission of r-process-enriched core-collapse SNe (rCCSNe).We use the semi-analytic model for rCCSNe of Barnes & Metzger (2022) (hereafter denoted as 'SNCol').The model depends on five free parameters: the total ejecta mass, M ej ; a characteristic ejecta velocity, v ej ; the 56 Ni mass, M Ni ; the r-process material mass, M rp ; and the mixing coordinate, Ψ mix .The ejecta are assumed to be spherically symmetric, with rprocess elements of mass m rp concentrated in an inner core whose total mass is Ψ mix m ej , with Ψ mix ≤ 1.An r-process-free envelope surrounds the core, and 56-Ni is distributed uniformly throughout the core and the envelope.The velocity v ej is defined such that the total kinetic energy of the ejecta E kin is equal to 1 2 M ej v 2 ej .3GRB afterglow: For modeling the GRB afterglow light curves, we employ the semi-analytic model of van Eerten et al. (2010) and Ryan et al. (2020), available in the public afterglowpy library (denoted as 'GRB-M').The model computes GRB afterglow emission and takes the following free parameters as input: the isotropic kinetic energy, E K,iso ; the viewing angle, θ Obs ; the halfopening angle of the jet core, θ c ; the outer truncation angle of the jet, θ w ; the interstellar medium density, n; the electron energy distribution index, p; and the fractions of the shock energy that go into electrons, ϵ e and magnetic fields, ϵ B .The model allows for several angular structures of the GRB jet.For our simulations, we assume a Gaussian or a top-hat jet structure (hereafter, 'Gauss' and 'top') 4 .It is important to note that, while we try to be agnostic concerning the origin of GRB 211211A, the GRB-M model that we employ has some limitations.Specifically, it does not include the emission from the reverse shock, which might be important at early times.Additionally, it does not include the wind-like interstellar medium, which is expected in the case of a collapsar.
In Fig. 1, we summarize our approach to analysing GRB 211211A based on the data set described in Sec. 2. We employ two different priors for the luminosity distance, namely a narrow Gaussian luminosity distance prior centered around 350 Mpc as reported by Rastinejad et al. ( 2022) and a uniform prior on the luminosity distance ranging between 0 and 3 Gpc.This allows us to investigate the potential influence of the distance on the GRB classification.Furthermore, we employ five models or model combinations to describe the different astrophysical scenarios.For the choice of a Gaussian luminosity distance prior, we report the prior settings for all parameters of the employed models in Table 2.Moreover, we use two different GRB jet types, resulting in 20 Bayesian inference simulations.

MULTI-WAVELENGTH ANALYSES
In the following three subsections, 4.1-4.3,we discuss our results for a narrow Gaussian prior on the luminosity distance in order to compare with previous studies.In subsection 4.4, we will investigate the influence of the distance prior choice and employ a wide uniform prior on the luminosity distance.

Model Comparison
As indicated in the Introduction, one of the main differences between previous studies and our work is that most previous works fitted first the X-ray and radio data with a GRB afterglow model, and then used the afterglow-subtracted optical and NIR photometry for fitting a kilonova model.In contrast, but similar to Yang et al. (2022), we perform a joint analysis of the GRB afterglow and a possible additional contribution such as a kilonova signature or emission from a rCCSN or CCSN.Moreover, in order to consider systematic uncertainties arising from different assumptions made in each model, we employ a 1 mag uncertainty in our simulations.
In Table 1, we summarize our main findings for the investigated astrophysical scenarios.We found that the BNS-GRB-M Kasen top model describes the observational data best, and hence we pick it as our reference model.Consequently, the Bayes factors and likelihood ratios in Table 1 are reported relative to this best-fitting inference run.With reference to Table 1, we show the maximum log-likelihood light-curve fits in Fig. 2 for each assessed scenario, which we will refer to as 'best-fitting light curves' hereafter.
Comparing only the two different BNS kilonova models, we find differences in the log-Bayes factors of about 4, disfavouring the BNS-GRB-M Bulla Gauss/top model compared to our reference model.Different GRB afterglow models lead only to a change of about 1 in the log-Bayes factor.Similarly, the employed GRB afterglow model has only a very small imprint of the maximum loglikelihood values, while different kilonova models lead to a change of order 3.These differences can be seen in Fig. 3 especially in the bands bessel-v, ps1-i, 2massj, and 2massks.Although the maximum likelihood light curve for the BNS-GRB-M Kasen  Gauss simulation is slightly favored as compared to our reference scenario, the difference is of the order of the statistical uncertainties.
It is worth pointing out that statistical uncertainties, as stated in the table, are noticeably smaller than model differences; that is, our results are dominated by systematic uncertainties in the underlying light-curve models.
Considering the differences between the NSBH and BNS scenarios, we find strong evidence that GRB 211211A was connected to a BNS rather than an NSBH system.This is reflected both in Bayes factors as well as maximum log-likelihood values as shown in Table 1.Comparing the respective best-fitting light curves in Fig. 2, we see that NSBH-GRB-M Bulla top fits the NIRband data worse compared with BNS-GRB-M Kasen top .With regard to the relative Bayes factors for the collapsar scenario, we find that there is decisive evidence that a BNS scenario is preferred over a collapsar origin for GRB 211211A when employing the light-curve models outlined in the previous section.However, it is important to note that the collapsar model depends on more parameters.Because of this, Occam's razor penalizes the model.
As indicated by Rastinejad et al. (2022), and confirmed by our study, we find that a Ni-powered SN event or an SN98bw-GRB-M scenario is noticeably less favored compared to a BNS merger.This is depicted in Fig. 2 in which SN98bw-GRB-M top fails to fit late-time NIR data, resulting in a larger, negative log-likelihood ratio.Moreover, the upper SN limits reported for the r-and i-band in Troja et al. (2022) rule out other supernova models.
Finally, our study confirms that the BNS-GRB-M Kasen top scenario provides decisive evidence when compared with GRB-M top simulations, even though the latter sampled over fewer parameters in the respective parameter estimation runs.Considering the impact of the choice of a Gaussian vs. top-hat jet structure on our Bayes factor results, we find a slight preference for the top-hat jet structure for all assessed scenarios, except for SN98bw-GRB-M top .).The four investigated scenarios of possible astrophysical origins (BNS, NSBH, SNCol, and SN98bw) are each assessed assuming a Gaussian or a top-hat jet structure.As reference, we list results for a stand-alone GRB-M investigation for both jet structures.

Presence of an additional component
Given the overall narrative that GRB 211211A was a GRB connected to a kilonova, we study the ability of the GRB-M with top-hat jet structure to describe the observational data and compare this with two BNS merger scenarios.For this purpose, we show the best-fitting light curves for BNS-GRB-M Bulla top , BNS-GRB-M Kasen top , and GRB top in Fig. 3 for a selection of the most informative bands.
We find that the GRB-M achieves a good representation of the data in the X-ray and UV bands (not all are shown in Fig. 3).However, the optical bands such as uvot-b and bessel-v already show that an additional component is required to describe the dimmer observational data observed roughly 1 d after trigger time.
This becomes even more pronounced in NIR bands, especially in the ps1-i and 2massks bands, where our reference model achieves the best representation.Overall, the joint model inferences of BNS-GRB-M Bulla top and BNS-GRB-M Kasen top achieve a better representation in the mentioned bands and the observational data points lie within the estimated 1 magnitude uncertainty (shaded band) of the best-fitting light curves.Hence, our analysis suggests that an additional source of energy generation is required to generate bright light curves in optical and NIR bands and to fit the observed data.

Source properties of the potential compact binary mergers
For the scenario that GRB 211211A was connected to a compact binary merger, which is favored by our  analysis, we now determine the source properties of the potential progenitor system.For this purpose, we use the inferred GRB afterglow and kilonova properties for both BNS-KN-Kasen and BNS-KN-Bulla and connect information about the ejecta and debris disc to the BNS properties following Dietrich et al. (2020); cf.Henkel et al. (2023) for a recent discussion about uncertainties in the employed numerical relativity-informed phenomenological relations.In Fig. 4, we show our inference results for a possible BNS source using BNS-GRB-M Kasen top , BNS-GRB-M Kasen  Gauss , and BNS-GRB-M Bulla top and contrast these with the prior probability regions for each parameter, in order to show how constraining the observational data are.Comparing inference results for BNS-GRB-M Kasen Top and BNS-GRB-M Kasen Gauss , we find that estimated source masses and tidal deformabilities are very similar.For the BNS-GRB-M Kasen Top simulation, we find that a BNS merger with a primary mass of 1.52 +0.49−0.38 M ⊙ and a secondary mass of 1.30 +0.24  −0.32 M ⊙ was the likely progenitor.The associated dimensionless tidal deformability of the system lies within Λ = 348 +855 −320 .With regard to a similar analysis for BNS-GRB-M Bulla Top , we find a primary mass of 1.57 +0.34  −0.28 M ⊙ and a secondary mass of 1.32 +0.19 −0.24 M ⊙ .The corresponding tidal deformability is 320 +426 −218 .Comparing estimated masses for BNS-GRB-M Kasen Top and BNS-GRB-M Bulla Top , we find overall good agreement within the stated uncertainties.
Overall, our estimated masses are consistent with Rastinejad et al. (2022), who concluded that GRB 211211A originated from a 1.4 M ⊙ +1 .3M ⊙ BNS merger.We expect that the remaining small differences are caused by the different analyses of the observed GRB 211211A data and by the fact that Rastinejad et al. (2022) assumed the inclination angle, under which the binary was observed, to be zero.Moreover, Rastinejad et al. (2022) assumed a fixed equation of state (EOS) from the EOS set of Dietrich et al. (2020) using additional information from Nicholl et al. (2021).In contrast, we leave the inclination angle as a free parameter in our analysis and use the updated EOS set of Huth et al. (2022).This set incorporates information from theoretical nuclear physics computations and from astrophysical observations of neutron stars such as Dietrich et al. (2020), but also heavy-ion collision experimental data.With regard to investigated binary merger scenarios, we find that the inferred inclination angle is around θ Obs ≈ 0.02 +0.02 −0.02 rad, while a larger inclination angle of θ Obs ≈ 0.04 +0.03 −0.02 rad is estimated for the considered supernova scenario (see Table 2).Rastinejad et al. (2022) deduced a total r-process ejecta mass of M ej = 0.047 +0.026 −0.011 M ⊙ , of which 0.02 M ⊙ correspond to lanthanide-rich ejecta, 0.01 M ⊙ to intermediate-opacity ejecta, and 0.01 M ⊙ to lanthanidefree material.In addition, Yang et al. (2022) reported a total ejecta mass of M ej = 0.037 +0.008 −0.004 M ⊙ .With our reference inference result from BNS-GRB-M Kasen top , we find a total ejecta mass of M BNS ej,Kasen = 0.016 +0.013 −0.009 M ⊙ , which is smaller than the result estimated by Rastinejad et al. (2022).Concerning our analysis based on BNS-GRB-M Bulla top , we found a total ejecta mass of M BNS ej,Bulla = 0.022 +0.021 −0.013 M ⊙ , of which 0.012M ⊙ can be attributed to lanthanide-rich ejecta, 0.006M ⊙ to intermediate opacity mass, and 0.001M ⊙ to lanthanide-free material.We note that during our analysis of GRB 211211A, we have also performed simulations not including the Swift-UVOT data.In such a case, we find larger total ejecta masses of M BNS ej,Kasen = 0.021 +0.017 −0.013 M ⊙ and M BNS ej,Bulla = 0.031 +0.033 −0.018 M ⊙ comparable to Rastinejad et al. (2022) and Yang et al. (2022).This finding sheds some light on the impact of different data sets being used to analyse astronomical sources such as GRB 211211A in a Bayesian context.
For completeness, we have performed a similar investigation for our NSBH-GRB-M top and NSBH-GRB-M Gauss models to infer the corresponding NSBH properties by making use of the relations provided in Foucart et al. (2018) and Krüger & Foucart (2020).Although the observational data do not provide a strong constraint on the NSBH source properties, our NSBH-GRB-M top analysis suggests that an NSBH merger with a BH mass of 3.11 +5.53  −2.23 M ⊙ and an NS mass of 1.40 +0.74 −0.81 M ⊙ could have been the progenitor of GRB 211211A, with a total ejecta mass of M NSBH ej = 0.006 +0.006 −0.004 M ⊙ .Likewise, the BH spin is weakly constrained to χ 1 = 0.00 +0.59  −0.60 for the NSBH-GRB-M top inference.Our inferred NS masses are in agreement with previous GW population analyses (Abbott et al. 2019;Abbott, R. and others 2021;Abbott et al. 2021) and with the maximum non-spinning NS mass of 2.7 +0.5 −0.4 M ⊙ estimated at 90 per cent credibility by Ye & Fishbach (2022).Within the estimated uncertainties, the inferred BH mass is close to the NSBH mass gap for which the lightest BH masses were estimated to be ∼ 5M ⊙ ( Özel et al. 2010;Farr et al. 2011).

Influence of the prior choice
Finally, we discuss the influence of a different luminosity distance prior on our results.The distance of GRB 211211A was relatively precisely estimated based on the redshift of the potential host galaxy, z = 0.0763 ± 0.0002 (Rastinejad et al. 2022).However, we are generally interested in the influence of a wide uniform luminosity distance prior on our results.For this reason, we widen the prior range and allow a distance between 0 and 3 Gpc.
Following the procedure in Sec.4.1, we have computed the logarithmic Bayes factors and found that BNS-GRB-M Kasen top remains to be the best-fitting model.Moreover, the differences in logarithmic Bayes factors between BNS-KN-Bulla and BNS-KN-Kasen remain the same.The Bayes factors are slightly smaller for all assessed scenarios when comparing to the results in Tab. 1.Interestingly, the SN98bw-GRB-M Gauss/top and the GRB-M Gauss/top are least favored, while the NSBH and collapsar scenario are more favored.Overall, our main conclusions remain valid also for the wider distance prior.
We investigated the posterior probability distributions obtained for a wide uniform distance prior and compared these with the ones obtained for a narrow Gaussian distance prior setting.In Fig. 5, we show an example for the obtained luminosity distance and the total ejecta mass distributions using BNS-GRB-M Kasen top .As can be seen, the wide distance prior leads to a noticeably weaker constraint on the distance and the total ejecta mass.The latter is caused by a degeneracy be- tween the luminosity distance and the ejecta mass.Generally, larger ejecta masses could compensate for larger distances and vice versa, which explains the shape of the 2D correlation plot of Fig. 5. Similarly (not shown in the figure), also the SNCol model predicts higher ejecta masses for larger distances.With respect to the SN-GRB and the GRB inferences, the GRB isotropic energy, log 10 (E K,iso ), tends to increase for larger distances, which is expected as brighter signals can be detected at further distances.

CONCLUSION
In this paper, we have performed multiple multiwavelength analyses for GRB 211211A assuming four different scenarios, namely a BNS merger, an NSBH merger, an rCCSN, as well as a CCSN.On the basis of joint multiwavelength Bayesian inferences combining respective kilonova or SN models with a GRB afterglow model, we investigated which which gave the strongest statistical evidence to explain the data detailed in Sec. 2. While emphasizing again that our study only considers a small proportion of possible astrophysical scenarios, and thus our results need to be considered with caution, we summarize our main conclusions below.
(i) On the basis of the four assessed scenarios and the employed models, we find statistical evidence for a BNS merger scenario; cf.Table 1.However, we can not fully rule out other scenarios.
(ii) Our study confirms that GRB 211211A can not solely be explained as a GRB afterglow and that an additional emission process (likely related to rprocess nucleosynthesis) is required for a good description of the observational data, mostly in optical and NIR bands (cf.Fig. 3).This emphasizes that near-infrared data at late times are essential to investigate the astrophysical origin of interesting transient objects.
(iii) Assuming a BNS origin, our study suggests that this system was a 1.

Figure 1 .
Figure1.Schematic illustration of our comprehensive Bayesian inference campaign performed to analyze GRB 211211A.We use one observational data set as described in Sec.2; two prior settings in which we mainly vary the luminosity distance prior while prior settings for other model parameters remained fixed and are reported in Table2; five models (including two different BNS kilonova models) or model combinations for four different astrophysical scenarios; and two GRB jet types (Gaussian and top-hat), resulting in 20 Bayesian inferences.

Figure 2 .
Figure 2. Best-fitting light curve from joint Bayesian inferences listed in Table 1 for possible scenarios: BNS-GRB-M Kasen top (red), NSBH-GRB-Mtop (cyan), SNCol-GRB-Mtop (orange), and SN98bw-GRB-Mtop (blue).The observational data of GRB 211211A in X-ray-1keV, radio-6GHz, UV, optical, and NIR band as discussed in Sec. 2 are shown as black dots, whereas black triangles refer to upper detection limits.Note that we are employing the naming convention of the sncosmo library for our work.

Figure 3 .
Figure 3. Best-fitting light curves from joint Bayesian inferences of BNS-GRB-M Bulla top (yellow) and BNS-GRB-M Kasen top (red) compared to a stand-alone GRB-Mtop inference (black) for X-ray, UV, optical and NIR bands on a logarithmic time scale in days since trigger time.

Figure 4 .
Figure 4. Component masses m1,2 and the dimensionless tidal deformability Λ based on our inference results of BNS-GRB-M Kasen Gauss (orange), BNS-GRB-M Kasen Top (red) and BNS-GRB-M Bulla Top (blue).Different shadings mark the 68 per cent, 95 per cent, and 99 per cent confidence intervals.For the 1D posterior probability distributions, we give the 90 per cent confidence interval (dashed lines) and report median values above each panel.Grey shaded areas give the prior probability regions.

Figure 5 .
Figure 5. Corner plot for BNS-GRB-M Kasen top with a narrow Gaussian luminosity distance prior centered around 350 Mpc (orange) and a wide uniform luminosity distance prior ranging up to 3 Gpc (blue).The inferred model parameters are shown at 68 per cent, 95 per cent, and 99 per cnet confidence (shadings from light to dark).For the 1D posterior probability distributions, we report the median values and show the 90 per cent confidence intervals as dashed lines.
received financial support from the Centre National de la Recherche Scientifique (CNRS) through Mission pour les initiatives transverses et interdisciplinaires (MITI) interdisciplinary programs.Sarah Antier thanks A. de Ugarte Postigo and J. Rastinejad for sharing data for this work.Sarah Antier also thanks Rahul Gupta, Jirong Mao, Robert Strausbaugh, Dong Xu, Jinzhong Liu, Daniele Malesani, Andrew Levan, and the Multicolor Imaging Telescopes for Survey and Monstrous Explosions (MITSuME) group for their useful comments on their observations.Mattia Bulla acknowledges support by the European Union's Horizon 2020 Programme under the AHEAD2020 project (grant agreement n. 871158).Tim Dietrich acknowledges support from the Deutsche Forschungsgemeinschaft, DFG, project number DI 2553/7.Nina Kunert and Tim Dietrich acknowledge support from the Daimler and Benz Foundation for the project 'NUMANJI'.Co-funded by the European Union (European Research Council (ERC), SMArt, 101076369).Views and opinions expressed are those of the authors only and do not necessarily reflect those of the European Union or the ERC.Neither the European Union nor the granting authority can be held responsible for them.Peter T. H. Pang is supported by the research program of the Netherlands Organization for Scientific Research (NWO).Michael W. Coughlin and Brian Healy acknowledges support from the National Science Foundation with grant numbers PHY-2308862 and OAC-2117997.The work of Ingo Tews was supported by the U.S. Department of Energy, Office of Science, Office of Nuclear Physics, under Contract No. DE-AC52-06NA25396, by the Laboratory Directed Research and Development program of Los Alamos National Laboratory under Project No. 20220541ECR, and by the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, Scientific Discovery through Advanced Computing (SciDAC) NU-CLEI program.Shreya Anand acknowledges support from the National Science Foundation GROWTH PIRE grant No. 1545949.This work used Expanse at the San Diego Supercomputer Cluster through allocation AST200029 -"Towards a complete catalog of variable sources to support efficient searches for compact binary mergers and their products" from the Advanced Cyberinfrastructure Coordination Ecosystem: Services & Support (ACCESS) program, which is supported by National Science Foundation grants #2138259, #2138286, #2138307, #2137603, and #2138296.

Table 2 ;
five models (including two different BNS kilonova models) or model combinations for four different astrophysical scenarios; and two GRB jet types (Gaussian and top-hat), resulting in 20 Bayesian inferences.