Introduction
Type Ia supernovae (SNe Ia) are standardisable candles that are useful in helping us infer properties of our Universe. It is thought that the thermonuclear explosions come from similar binary progenitor systems involving at least one white dwarf ((Ruiter & Seitenzahl 2025)). The similar initial conditions result in homogeneity in how their luminosities correlate with apparent light curve properties. Particularly, SNe that appear bluer in colour are often brighter, as are those whose light curves evolve more slowly ((Phillips 1993)). These correlations are conventionally expressed in a linear standardisation model of the SN’s absolute magnitude ((Tripp 1998)), which may be combined with the apparent magnitude to calculate its distance modulus using the inverse square law.
To constrain cosmological properties, inferred SNe distances, along with redshifts, are plotted on the Hubble diagram. This led to the discovery of the accelerating expansion of the Universe, providing evidence for dark energy ((Riess et al. 1998; Perlmutter et al. 1999)). More recently, SNe distances ([28 ] (Brout et al. 2022; Rubin et al. 2025)), combined with constraints from baryon acoustic oscillations ((Adame et al. 2025)) and the cosmic
microwave background (Planck Collaboration et al. [104 ] ), have provided evidence for an evolving dark energy equation of state. Current debates centre on whether the preference towards the alternative cosmological parameterisation is a signal of new fundamental physics or merely a residual artefact from survey systematics ((Efstathiou 2025; Vincenzi et al. 2025; Dhawan et al. 2025)). Recent recalibration of the DES 5YR SN Ia sample ((Popovic et al. 2026c,b)) using DA white dwarfs ((Boyd et al. 2025)) reduced the significance of the evolving dark energy results from ∼ 4 σ \sim4\sigma ∼ 4 σ to ∼ 3 σ \sim3\sigma ∼ 3 σ , emphasising the importance of scrutinising the full analysis pipeline.
An important systematic to consider in SN Ia cosmology is the influence of selection effects. The barium bias ((Malmquist 1922)) is a common selection effect whereby our flux-limited surveys preferentially detect brighter objects. Selection effects can also arise from colour preferences, cadence-driven sensitivity to light curve duration and the spatio-temporal observing plan ((Lochner et al. 2018, 2022)). Further selection cuts are often applied in post-processing depending on data quality and light curve fits. If left unaccounted for, these selection effects can strongly bias constraints on both cosmological parameters and inferred SN Ia population parameters.
The inferences of population parameters not only inform our astrophysical understanding of SNe Ia, but also feed back into informing their standardisation. SNe Ia in higher mass host-galaxies have been observed to be apparently brighter than those in lower mass galaxies (Kelly et al. 2010; Sullivan et al. 2010; Lampeitl et al. 2010; Childress et al. 2013; Kelsey et al. 2021, 2023), in a phenomenon known as the “mass-step”. This has motivated investigations as to whether the mass-step originates from intrinsic differences in SN progenitors or differing dust properties in the galactic environment (Thorp & Mandel 2022; Brout & Scolnic 2021; Murakami & Scolnic 2025; Ginolin et al. 2026). Investigations into the mass-step have benefited from fitters that explicitly model dust parameters separately from intrinsic SN parameters (Mandel et al. 2009, 2014, 2017, 2022; Thorp et al. 2021; Popovic et al. 2023; Grayling et al. 2024). Due to the biases that selection effects can impose on population parameter inferences, studies on extrinsic and intrinsic population parameters, as well as the mass-step, are often conducted on volume-limited samples (Ginolin et al. 2025a; Murakami & Scolnic 2025; Ginolin et al. 2026; Giunta et al. 2026).
Systematic uncertainties in the modern era will become even more challenging as we move to larger wide-field photometric surveys, such as the Vera C. Rubin Observatory’s Legacy Survey of Space and Time (LSST, Ivezić et al. 2019) and the Nancy Grace Roman Space Telescope (Roman, Hounsell et al. 2018), that will have orders of magnitude more SNe than current samples. Previously, SN Ia cosmological studies have benefited from a spectroscopic redshift with negligible observational uncertainties. The future of SN cosmology will instead have photometric redshift estimates that are substantially more uncertain and often multimodal (Carrasco Kind & Brunner 2013; Jones & Heavens 2019; Thorp et al. 2024; Autenrieth et al. 2024; Chen et al. 2025). Furthermore, SN Ia classification has historically required a spectrum to identify distinct silicon absorption features. Whilst surveys such as TiDES (Frohmaier et al. 2025) are rising to the challenge to spectroscopically classify as many transients as possible, many of today’s surveys will classify most SNe Ia using photometry alone, utilising neural network approaches (e.g. Muthukrishna et al. 2019; Boone 2019; Möller & de Boissière 2020; Qu et al. 2021). Photometric classifications will be imperfect, so cosmological analyses must account for non-Ia contamination.
The increasing complexities of SN Ia cosmology have necessitated bespoke inference pipelines that correctly handle uncertainties and systematics. Hierarchical Bayesian modelling provides an interpretable statistical framework for modelling SN populations, including physical priors and latent parameter relationships whilst consistently propagating uncertainty (Mandel et al. 2009, 2011, 2014, 2017, 2022; March et al. 2011; Scalzo et al. 2014; Shariff et al. 2016; Thorp et al. 2021; Grayling et al. 2024; Sarin et al. 2026). These models may be extended to account for selection effects in SN Ia cosmology by assuming the probability a SN is selected is a function of its observed properties (Rubin et al. 2015; March et al. 2018; Rubin et al. 2025, 2026; Hoyt et al. 2026). The probability of selection is assumed to take a simplified analytical form, such as a smooth sigmoid, allowing the likelihood to be analytically tractable. In practice, the true probability of selection may not be well represented by a simple parametric form after several layers of selection and quality cuts inherent in modern survey pipelines.
An alternative approach to modelling selection effects in SNe Ia samples is by using survey simulators (Kessler et al. 2009; Rigault et al. 2026; Dai et al. 2026; Grayling 2026). Modern simulators are able to emulate surveys to high fidelity, implementing true observing catalogues, instrumental systematics and data processing pipelines. They also are able to forward model different SN population models, physical dust effects and host-galaxy association. A popular method that uses these simulations to account for selection effects is BEAMS with Bias Corrections (BBC, Kessler & Scolnic 2017).
One-dimensional BBC involves simulating SNe under an assumed cosmology and fitting them to estimate their distance. The simulated SNe are then split into redshift bins, where the average difference between the true simulated distance and the fitted distance in each bin can be calculated. The average differences in distances, known as bias corrections, are applied to the real SNe distance estimates before Hubble diagram regression to infer cosmological parameters. It is expected that SNe in the highest redshift bins will have the largest bias correction due to Malmquist bias. BBC can also be performed in higher dimensional bins, for example in colour and light curve timescale. The method also employs Bayesian Estimation Applied to Multiple Species (BEAMS, Kunz et al. 2007), using an explicit mixture model approach for handling non-SN Ia contamination. This methodology is able to account for non-trivial selection processes, although there is still a known dependence on the fiducial cosmology assumed in the bias correction simulations. Investigations have found the influence of the assumed fiducial cosmology is insignificant for present day analyses (Camilleri et al. 2024), however, with scaling sample sizes it may become a dominant systematic. Furthermore, what the correct binning procedure to use in the uncertain photometric redshift regime remains unclear, with early forecasts using the analysis pipeline showing significant biases (Mitra et al. 2026).
Simulation-based inference (SBI) provides a natural workflow for learning probabilistic relationships between global parameters and observed data (Cranmer et al. 2020). The probabilistic relationships are commonly approximated with flexible neural networks that are trained on simulations and applied to real data at inference time. Since neural networks are universal function approximators, we are able to approximate distributions that are analytically intractable. SBI has been used in the context of SN Ia cosmology (Alsing et al. 2019; Karchev et al. 2023b; Karchev & Trotta 2025), capturing complexities such as selection effects and non-Gaussian photometric redshift uncertainties implicitly through the survey simulations. One can infer a variety of SN dust and host galaxy population parameters by including these effects in the simulator’s forward model (Karchev et al. 2024, 2026; Popovic et al. 2026a). Other SBI approaches can also help choose which model, such as the parameterisation for the host galaxy mass-step, the data supports using the Bayesian evidence (Jeffrey & Wandelt 2024; Karchev et al. 2023a; Popovic et al. 2026a).
A drawback of using neural networks to learn the full probabilistic relationship between global parameters of interest and data is the loss of interpretability. This also requires rerunning simulations and retraining for each cosmological and SN Ia model we wish to constrain. Instead, a best-of-both-worlds approach is to use analytical hierarchical modelling for the upstream parameter relationships and then use SBI only for the downstream relationships that are intractable to derive. This modular SBI approach to SN Ia cosmology defines the FlowSN methodology (Boyd et al. 2024, 2026). FlowSN combines SBI with hierarchical Bayesian modelling, using flexible normalising flows (Tabak & Vanden-Eijnden 2010; Tabak & Turner 2013) to approximate the intractable observed data likelihood conditioned on the latent distance modulus and redshift. Conditioning on latent parameters allowed for upstream cosmological parameters to be changed with ease, enabling the same neural network to reliably constrain a variety of cosmological models beyond the fiducial training cosmology. FlowSN was tested on state-of-the-art SNANA survey simulations (Kessler et al. 2009) where it was found to be less biased and had improved uncertainty calibration over the traditional BBC methodology (Kessler & Scolnic 2017). The original formulation of the framework used the simplest linear SN Ia standardisation model (Tripp 1998) and was only applicable to spectroscopic surveys with negligible redshift uncertainties.
In this FlowSN2 work we expand our methodology for the future of photometric SN Ia cosmology. The problem is reframed from a regression on the Hubble diagram of distance as a function of a well-determined spectroscopic redshift, to a joint problem where we consider photometric redshifts as data with uncertainties. In practice, this means including an additional observable data dimension in our first normalising flow and then training a second network to learn the joint distance modulus-redshift distribution under the influence of selection. This combination allows for amortisation on the Hubble diagram, enabling the model to constrain a range of cosmological parameterisations. We also get the added benefit of being able to infer SN rates under the influence of selection. The SN standardisation is upgraded to the Simple-BayeSN model (Mandel et al. 2017), which allows for explicit separation of extrinsic dust and intrinsic SN parameters, as well as host-galaxy mass-steps. We tackle the possibility of photometric contamination from non-Ia objects, which may have misspecified likelihoods, using the modular Bayesian resampling approach proposed by Autenrieth et al. (2026). This treatment is convenient as it requires no retraining of our likelihood approximations and no explicit likelihood model for the contaminant population. Finally, we show that with little additional cost, we can perform model comparison in these complex settings, allowing us to choose which model, be it the mass-step parameterisation or evolving dark energy, the data supports.
The general FlowSN2 statistical model is defined in § 2 , where we outline the assumed forward model, posterior construction, model comparison procedure, contamination treatment and the training of the normalising flows. In § 3 , we show results on a simplified forward model that has an analytical likelihood solution, useful for verifying that FlowSN2 accurately reproduces the corresponding analytical-likelihood posteriors. We also include demonstrations of inference under contamination, scalability and model selection. In § 4 , we conclude with future avenues for the work and its implications as a powerful framework for SN Ia cosmology.
In Appendix § 6 , we derive the analytical likelihood solution for our survey simulations, used to validate our method. We also include further experimental details, such as training ranges and priors, in Appendix § 7 to Appendix D. Further investigation into posterior biases and calibration is detailed in Appendix E.
Method
In this section, we define the general methodology used in the FlowSN2 statistical framework that can be applied to realistic photometric SN cosmology analyses. In § 2.1 , we describe the general generative forward model assumed in our methodology. § 2.6 describes the assumptions and procedures needed to construct the SN likelihood and sample the posterior on cosmology and population parameters. We discuss how to combine likelihoods from multiple surveys in § 2.7 . § 2.8 shows us how to re-use our likelihoods to compute Bayes factors and perform model selection. In § 2.9 , we describe how to perform inference under the influence of contamination from non-Ia objects. The procedure used to train our two normalising flows is described in § 2.10 . Finally, we give details on our implementation of the framework in § 2.12 .
Forward Model
We first establish the general probabilistic generative model we have designed to account for the stochastic and uncertain effects that influence the observed light curve summary statistics and redshifts following selection. Within this framework, variables associated to an individual supernova are marked with the subscript s s s , thereby distinguishing them from the global parameters that characterise the population across all SNe.
Photometric Redshifts
The true CMB-frame redshift z s z_s z s for an individual SN with index s s s is sampled from a distribution composed of a volumetric rate R ( z ) R(z) R ( z ) and a differential co-moving volumetric component d V c / d z \mathrm{d}V_c/\mathrm{d}z d V c / d z , according to
z s ∼ P ( z ∣ ξ r a t e , C ) ∝ R ( z ; ξ r a t e ) 1 + z ∣ d V c ( z ; C ) d z ∣ . (1) z_s \sim P(z \mid\xi_{\mathrm{rate}}, \boldsymbol{C}) \propto\frac{R(z;\xi_{\mathrm{rate}})}{1+z}\left|\frac{\mathrm{d}V_c(z;\boldsymbol{C})}{\mathrm{d}z}\right|. \tag*{(1)} z s ∼ P ( z ∣ ξ rate , C ) ∝ 1 + z R ( z ; ξ rate ) d z d V c ( z ; C ) . (1)
In this work, the volumetric rate is assumed to follow a power-law R ( z ; ξ r a t e ) ∝ ( z + 1 ) ξ r a t e R(z;\xi_{\mathrm{rate}}) \propto(z+1)^{\xi_{\mathrm{rate}}} R ( z ; ξ rate ) ∝ ( z + 1 ) ξ rate bounded by z l o w < z s < z m a x z_{\mathrm{low}} < z_s < z_{\mathrm{max}} z low < z s < z max , where ξ r a t e \xi_{\mathrm{rate}} ξ rate represents a rate parameter describing its steepness. Time dilation is accounted for by the ( 1 + z s ) (1+z_s) ( 1 + z s ) factor in the denominator (Dilday et al. 2008), and V c V_c V c denotes the co-moving volume, which is itself a function of redshift and the cosmological parameter values C \boldsymbol{C} C (Hogg 1999).
The observer-frame or heliocentric redshift z s h e l z_s^{\mathrm{hel}} z s hel results from the perturbation of the CMB-redshift by peculiar velocities v p e c s v_{\mathrm{pec}}^s v pec s and the observer’s velocity relative to the CMB rest-frame projected along the line of sight to each SN v ⊙ s v_\odot^s v ⊙ s , expressed as
z s h e l = ( z s + 1 ) ( v ⊙ s c + 1 ) ( v p e c s c + 1 ) − 1. (2) z_s^{\mathrm{hel}} = (z_s+1)\left(\frac{v_\odot^s}{c}+1\right)\left(\frac{v_{\mathrm{pec}}^s}{c}+1\right)-1. \tag*{(2)} z s hel = ( z s + 1 ) ( c v ⊙ s + 1 ) ( c v pec s + 1 ) − 1. (2)
A SN’s peculiar velocity v p e c s v_{\mathrm{pec}}^s v pec s is typically unknown. The peculiar velocity sampling distribution v p e c s ∼ P ( v p e c ) v_{\mathrm{pec}}^s \sim P(v_{\mathrm{pec}}) v pec s ∼ P ( v pec ) is usually assumed to be Gaussian (σ p e c ≃ 300 k m s − 1 \sigma_{\mathrm{pec}} \simeq300\ {\rm km\ s}^{-1} σ pec ≃ 300 km s − 1 ), though may be further constrained with observations (Do et al. [35 ] ) or simulations (Okumura et al. 2014). This updated version of the FlowSN methodology works in both regimes where either the normalising flow learns the general influence of peculiar velocities from simulations or it may be conditioned on z s h e l z_s^{\mathrm{hel}} z s hel given known peculiar velocities. We assume v ⊙ s v_\odot^s v ⊙ s can be calculated deterministically using the coordinates of the SN and our Sun’s speed relative to the CMB (≃ 369 k m s − 1 \simeq369\ {\rm km\ s}^{-1} ≃ 369 km s − 1 ). The speed of light in km s− 1 ^{-1} − 1 is denoted by c c c .
We then measure heliocentric redshifts according to
z ^ s h e l ∼ P ( z ^ s h e l ∣ z s h e l , σ z , s ) , (3) \hat{z}_s^{\mathrm{hel}} \sim P(\hat{z}_s^{\mathrm{hel}} \mid z_s^{\mathrm{hel}},\sigma_{z,s}), \tag*{(3)} z ^ s hel ∼ P ( z ^ s hel ∣ z s hel , σ z , s ) , (3)
Boyd et al. (2026) only considered spectroscopic redshifts, where uncertainty on the measurement was assumed to be very small σ z , s ≈ 10 − 5 \sigma_{z,s} \approx10^{-5} σ z , s ≈ 1 0 − 5 . This work considers photometric redshift uncertainties where the sampling distribution may be broader σ z , s ∼ 0.03 ( 1 + z s h e l ) \sigma_{z,s} \sim0.03(1+z_s^{\mathrm{hel}}) σ z , s ∼ 0.03 ( 1 + z s hel ) , non-Gaussian or even multimodal.
We deterministically convert the measured heliocentric redshift into the measured CMB-frame redshift z ^ s \hat{z}_s z ^ s using
z ^ s = ( 1 + z ^ s h e l 1 + v ⊙ s / c ) − 1. (4) \hat{z}_s = \left(\frac{1+\hat{z}_s^{\mathrm{hel}}}{1+v_\odot^s/c}\right)-1. \tag*{(4)} z ^ s = ( 1 + v ⊙ s / c 1 + z ^ s hel ) − 1. (4)
Further corrections can also be made to account for peculiar velocities using velocity field maps (Carrick et al. 2015; Stiskalek et al. 2026).
Luminosity Distance
In the Cosmic Microwave Background (CMB) rest frame, the luminosity distance d L s d_L^s d L s is defined as
d L s = ( z s + 1 ) d c ( z s ; C ) , (5) d_L^s = (z_s+1)d_c(z_s;\boldsymbol{C}), \tag*{(5)} d L s = ( z s + 1 ) d c ( z s ; C ) , (5)
where the transverse co-moving distance d c d_{\mathrm{c}} d c (expressed in parsecs) is determined by the true CMB-frame redshift z s z_{\mathrm{s}} z s and the cosmological parameter vector C \boldsymbol{C} C . To transform this quantity into the observer frame, the luminosity distance d L s d_{\mathrm{L}}^{\mathrm{s}} d L s is modified by kinematic corrections such that
d L s = ( v ⊙ s c + 1 ) ( v p e c s c + 1 ) 2 d L s . (6) d_{\mathrm{L}}^{\mathrm{s}}=\left(\frac{v_{\odot}^{\mathrm{s}}}{c}+1\right)\left(\frac{v_{\mathrm{pec}}^{\mathrm{s}}}{c}+1\right)^{2}d_{\mathrm{L}}^{\mathrm{s}}. \tag*{(6)} d L s = ( c v ⊙ s + 1 ) ( c v pec s + 1 ) 2 d L s . (6)
Both velocity terms account for Doppler shifting, with the peculiar velocity entering quadratically to additionally compensate for relativistic beaming effects (Davis et al. 2011).
For clarity, we define the baseline CMB-frame distance modulus as
μ ( z ; C ) = 5 log 10 ( d L 10 p c ) = 5 log 10 ( 1 10 p c ( z + 1 ) d c ( z ; C ) ) , (7) \mu(z;\boldsymbol{C})=5\log_{10}\left(\frac{d_{\mathrm{L}}}{10\ \mathrm{pc}}\right)=5\log_{10}\left(\frac{1}{10\ \mathrm{pc}}(z+1)d_{\mathrm{c}}(z;\boldsymbol{C})\right), \tag*{(7)} μ ( z ; C ) = 5 log 10 ( 10 pc d L ) = 5 log 10 ( 10 pc 1 ( z + 1 ) d c ( z ; C ) ) , (7)
whereas the full observer-frame distance modulus μ ˉ \bar{\mu} μ ˉ is given by
μ ˉ ( z , v p e c , v ⊙ ; C ) = 5 log 10 ( d ˉ L 10 p c ) = 5 log 10 ( 1 10 p c ( z + 1 ) ( v ⊙ c + 1 ) ( v p e c c + 1 ) 2 d c ( z ; C ) ) . (8) \bar{\mu}(z,v_{\mathrm{pec}},v_{\odot};\boldsymbol{C})=5\log_{10}\left(\frac{\bar{d}_{\mathrm{L}}}{10\ \mathrm{pc}}\right)
=5\log_{10}\left(\frac{1}{10\ \mathrm{pc}}(z+1)\left(\frac{v_{\odot}}{c}+1\right)\left(\frac{v_{\mathrm{pec}}}{c}+1\right)^{2}d_{\mathrm{c}}(z;\boldsymbol{C})\right). \tag*{(8)} μ ˉ ( z , v pec , v ⊙ ; C ) = 5 log 10 ( 10 pc d ˉ L ) = 5 log 10 ( 10 pc 1 ( z + 1 ) ( c v ⊙ + 1 ) ( c v pec + 1 ) 2 d c ( z ; C ) ) . (8)
Dusty Simple-BayeSN Forward Model with Mass-Step
The original FlowSN model (Boyd et al. 2026) used the simple Tripp (1998) formula to standardise SNe. In this work, to distinguish between intrinsic SN colour and extrinsic dust, we use a generalised version of the Simple-BayeSN probabilistic generative model (Mandel et al. 2017).
The intrinsic light curve shape x s x_{\mathrm{s}} x s , which is alternatively referred to as the stretch depending on the SN Ia spectral energy distribution (SED) model, is assumed to be sampled from a population distribution
x s ∼ P ( x ∣ z s , θ x ) . (9) x_{\mathrm{s}}\sim P(x\mid z_{\mathrm{s}},\boldsymbol{\theta}_{x}). \tag*{(9)} x s ∼ P ( x ∣ z s , θ x ) . (9)
This population distribution is parametrised by θ x \boldsymbol{\theta}_{x} θ x , that typically defines properties such as the population’s central value and width. The specific nature of these population distributions has been evaluated extensively in the literature (Guy et al. 2007; Betoule et al. 2014; Dimitriadis et al. 2025; Ginolin et al. 2025b). Additionally, we explicitly include a conditioning on z s z_{\mathrm{s}} z s because previous work demonstrates that these demographic distributions evolve significantly across cosmic time (Nicolas et al. 2021). In Mandel et al. (2017), the light curve shape population distribution is assumed to be Gaussian, whereas in this FlowSN formalism we have freedom to simulate more complex distributions and learn the influence on observed data distributions with the flexible normalising flow.
Similarly, the intrinsic SN colour is drawn from the general population distribution
c s i n t ∼ P ( c i n t ∣ x s , z s , θ c i n t ) . (10) c_{\mathrm{s}}^{\mathrm{int}}\sim P(c^{\mathrm{int}}\mid x_{\mathrm{s}},z_{\mathrm{s}},\boldsymbol{\theta}_{c}^{\mathrm{int}}). \tag*{(10)} c s int ∼ P ( c int ∣ x s , z s , θ c int ) . (10)
We parametrise the distribution with θ c i n t \boldsymbol{\theta}_{c}^{\mathrm{int}} θ c int , which can influence the shape of the colour distribution (Grayling & Popovic 2025; Ginolin et al. 2026; Giunta et al. 2026). We condition on x s x_{\mathrm{s}} x s to allow for correlations with light curve shape and also on z s z_{\mathrm{s}} z s to consider the population distribution evolving with time (Popovic et al. 2025). As with the light curve shape population distribution, FlowSN is able to model any arbitrary intrinsic colour population distribution that may be non-Gaussian or asymmetric. The extrinsic colour excess or dust reddening is denoted by E s ≡ E ( B − V ) E_{\mathrm{s}}\equiv E(B-V) E s ≡ E ( B − V ) for SNe. The colour excess per SN is drawn from
E s ∼ P ( E ∣ τ ) , (11) E_{\mathrm{s}}\sim P(E\mid\tau), \tag*{(11)} E s ∼ P ( E ∣ τ ) , (11)
where the variable τ \tau τ represents the prior mean average. The prior represents the population distribution of E s E_{\mathrm{s}} E s values along the line of sight, from the SN through the host galaxy. The E s E_{\mathrm{s}} E s variable is physically constrained to be E s ≥ 0 E_{\mathrm{s}}\geq0 E s ≥ 0 . Mandel et al. (2017), Jha et al. (2007), chooses an exponential distribution for E s E_{\mathrm{s}} E s , while other studies have called for the use of alternative priors such as the Weibull distribution (Duarte et al. 2026). Some forms for the population prior have analytical convenience when integrating with Gaussian distributions to marginalise over latent parameters. FlowSN is able to implicitly marginalise over colour excess E s E_{\mathrm{s}} E s regardless of the form of the dust prior. The apparent colour is modelled as the sum of the intrinsic colour and the colour excess such that
c s a p p = c s i n t + E s . (12) c_{\mathrm{s}}^{\mathrm{app}}=c_{\mathrm{s}}^{\mathrm{int}}+E_{\mathrm{s}}. \tag*{(12)} c s app = c s int + E s . (12)
In Mandel et al. (2017), the extinguished apparent magnitude is modelled as
m s = M 0 i n t + μ ˉ s + α x s + β i n t c s i n t + R B E s + γ δ s M + ϵ s i n t , (13) m_{\mathrm{s}}=M_{0}^{\mathrm{int}}+\bar{\mu}_{\mathrm{s}}+\alpha x_{\mathrm{s}}+\beta_{\mathrm{int}}c_{\mathrm{s}}^{\mathrm{int}}+R_{B}E_{\mathrm{s}}+\gamma\delta_{\mathrm{s}}^{M}+\epsilon_{\mathrm{s}}^{\mathrm{int}}, \tag*{(13)} m s = M 0 int + μ ˉ s + α x s + β int c s int + R B E s + γ δ s M + ϵ s int , (13)
where μ ˉ s = μ ˉ ( z s , v p e c s , v ⊙ s ; C ) \bar{\mu}_{\mathrm{s}}=\bar{\mu}(z_{\mathrm{s}},v_{\mathrm{pec}}^{\mathrm{s}},v_{\odot}^{\mathrm{s}};\boldsymbol{C}) μ ˉ s = μ ˉ ( z s , v pec s , v ⊙ s ; C ) and the α \alpha α coefficient captures the usual “broader-brighter” width–luminosity relation (Phillips 1993). The α \alpha α coefficient is modelled as a constant, although it has been observed to have a non-linear light curve shape dependence (Larison et al. 2024; Ginolin et al. 2025b), which would be a trivial extension to this work. The Simple-BayeSN (Mandel et al. 2017) parametrisation deviates from the traditional Tripp (1998) formula due to its explicit separation of the intrinsic “redder-dimmer” colour coefficient β i n t \beta_{\mathrm{int}} β int and extrinsic dust relation R B ≡ A B / E ( B − V ) R_{B}\equiv A_{B}/E(B-V) R B ≡ A B / E ( B − V ) parameters, where A B A_{B} A B is B B B -band dust extinction. As a result of the explicit dust modelling, the residual scatter ϵ s i n t \epsilon_{\mathrm{s}}^{\mathrm{int}} ϵ s int is attributed to intrinsic effects ϵ s i n t ∼ N ( 0 , σ i n t 2 ) \epsilon_{\mathrm{s}}^{\mathrm{int}}\sim N(0,\sigma_{\mathrm{int}}^{2}) ϵ s int ∼ N ( 0 , σ int 2 ) . The intrinsic absolute magnitude constant for a SN with light curve shape x s = 0 x_{\mathrm{s}}=0 x s = 0 and intrinsic colour c s i n t = 0 c_{\mathrm{s}}^{\mathrm{int}}=0 c s int = 0 is denoted by M 0 i n t M_{0}^{\mathrm{int}} M 0 int .
We model a simple mass-step (Kelly et al. 2010; Sullivan et al. 2010; Lampeitl et al. 2010; Childress et al. 2013; Ginolin et al. 2026) using a γ \gamma γ coefficient such that
δ s M = { 0 if M s ≤ M s t e p , 1 if M s > M s t e p (14) \delta_{\mathrm{s}}^{M}=
\begin{cases}
0 & \text{if } \mathcal{M}_{\mathrm{s}}\leq\mathcal{M}_{\mathrm{step}},\\
1 & \text{if } \mathcal{M}_{\mathrm{s}}>\mathcal{M}_{\mathrm{step}}
\end{cases} \tag*{(14)} δ s M = { 0 1 if M s ≤ M step , if M s > M step (14)
where M s \mathcal{M}_{\mathrm{s}} M s is the mass of the host galaxy in which SN s resides, drawn from the galaxy population distribution M s ∼ P ( M s ∣ θ g a l ) \mathcal{M}_{\mathrm{s}}\sim P(\mathcal{M}_{\mathrm{s}}\mid\boldsymbol{\theta}_{\mathrm{gal}}) M s ∼ P ( M s ∣ θ gal ) with population parameters θ g a l \boldsymbol{\theta}_{\mathrm{gal}} θ gal that may be arbitrarily complex. The threshold M s t e p ∼ 10 10 M ⊙ \mathcal{M}_{\mathrm{step}}\sim10^{10}M_{\odot} M step ∼ 1 0 10 M ⊙ . Separating intrinsic SN and extrinsic dust parameters using a similar threshold (Mandel et al. 2017; Rubin et al. 2026; Wojtak et al. 2026) is straightforward in the FlowSN2 methodology, as we demonstrate in our model selection experiments in § 3.5 .
For notational clarity, the population-level parameters for the SN model are represented by the vector Θ S N = ( M 0 i n t , α , β i n t , R B , τ , γ , σ i n t , θ x , θ c i n t ) \boldsymbol{\Theta}_{\mathrm{SN}}=(M_{0}^{\mathrm{int}},\alpha,\beta_{\mathrm{int}},R_{B},\tau,\gamma,\sigma_{\mathrm{int}},\boldsymbol{\theta}_{x},\boldsymbol{\theta}_{c}^{\mathrm{int}}) Θ SN = ( M 0 int , α , β int , R B , τ , γ , σ int , θ x , θ c int ) .
Light Curve Data and Summary Statistic Fits
We assume the light curve simulation and summary statistic fitting to be the same as what was modelled in Boyd et al. (2026). We reproduce the assumptions here for convenience. The simulated latent variables d s = ( m s , c s a p p , x s ) T \boldsymbol{d}_{\mathrm{s}}=(m_{\mathrm{s}},c_{\mathrm{s}}^{\mathrm{app}},x_{\mathrm{s}})^{T} d s = ( m s , c s app , x s ) T dictate the underlying SED of the supernova (e.g., Mandel et al. 2022; Kenworthy et al. 2021). We characterise the SED F ( T , λ 0 , d s , z h e l ) F(T,\lambda_{0},d_{\mathrm{s}},z_{\mathrm{hel}}) F ( T , λ 0 , d s , z hel ) as a continuous function mapped across observer-frame time T T T and wavelength λ o \lambda_o λ o , as well as the latent parameters and the heliocentric redshift. To evaluate the latent flux f s , i f_{s,i} f s , i for a given observation i i i of SN s s s recorded at observer-frame time T s , i T_{s,i} T s , i , the SED is integrated against the transmission efficiency function T X ( λ o ) T_X(\lambda_o) T X ( λ o ) of passband X according to
f s , i = 10 0.4 × Z s , i × ( ∫ 0 ∞ λ o ⋅ F ( T s , i , λ o ; d s , z s h e l ) ⋅ T X ( λ o ) ⋅ d λ o ∫ 0 ∞ λ o ⋅ F s t d ( λ o ) ⋅ T X ( λ o ) ⋅ d λ o ) (15) f_{s,i}=10^{0.4\times Z_{s,i}}\times\left(\frac{\int_0^\infty\lambda_o\cdot F(T_{s,i},\lambda_o;\boldsymbol{d}_s,z_s^{\mathrm{hel}})\cdot T_X(\lambda_o)\cdot\mathrm{d}\lambda_o}{\int_0^\infty\lambda_o\cdot F_{\mathrm{std}}(\lambda_o)\cdot T_X(\lambda_o)\cdot\mathrm{d}\lambda_o}\right) \tag*{(15)} f s , i = 1 0 0.4 × Z s , i × ( ∫ 0 ∞ λ o ⋅ F std ( λ o ) ⋅ T X ( λ o ) ⋅ d λ o ∫ 0 ∞ λ o ⋅ F ( T s , i , λ o ; d s , z s hel ) ⋅ T X ( λ o ) ⋅ d λ o ) (15)
where F s t d ( λ o ) F_{\mathrm{std}}(\lambda_o) F std ( λ o ) denotes the spectral flux density of a spectrophotometric reference standard, measured in ergs cm− 2 ^{-2} − 2 s− 1 ^{-1} − 1 Å− 1 ^{-1} − 1 (e.g., Narayan et al. 2019; Boyd et al. 2025). The instrumental zeropoint is defined via a reference magnitude within the given passband as Z s , i = 27.5 + m s , i s t d Z_{s,i}=27.5+m_{s,i}^{\mathrm{std}} Z s , i = 27.5 + m s , i std . Generally, SED frameworks transform the temporal and spectral axes into the rest frame (Mandel et al. 2022; Kenworthy et al. 2021). Specifically, the rest-frame phase t s , i t_{s,i} t s , i relative to the epoch of maximum B B B -band brightness is evaluated as t s , i ≡ ( T s , i − T s m a x ) / ( 1 + z s h e l ) t_{s,i}\equiv(T_{s,i}-T_s^{\mathrm{max}})/(1+z_s^{\mathrm{hel}}) t s , i ≡ ( T s , i − T s max ) / ( 1 + z s hel ) , where T s m a x T_s^{\mathrm{max}} T s max represents the estimated observer-frame date of peak luminosity. The rest-frame wavelength is also calculated via λ r ≡ λ o / ( 1 + z s h e l ) \lambda_r\equiv\lambda_o/(1+z_s^{\mathrm{hel}}) λ r ≡ λ o / ( 1 + z s hel ) .
The empirical light curve data point f ^ s , i \hat{f}_{s,i} f ^ s , i is subject to diverse stochastic instrumental perturbations. For mathematical convenience, these random variations are modelled under the assumption of Gaussian measurement uncertainties
f ^ s , i ∼ N ( f s , i , σ f , s , i 2 ) , (16) \hat{f}_{s,i}\sim\mathcal{N}(f_{s,i},\sigma_{f,s,i}^{2}), \tag*{(16)} f ^ s , i ∼ N ( f s , i , σ f , s , i 2 ) , (16)
where σ f , s , i \sigma_{f,s,i} σ f , s , i denotes the localised flux measurement uncertainty. The complete photometric dataset for a given supernova s s s , comprising N s o b s N_s^{\mathrm{obs}} N s obs data points, is gathered into the vectors f ^ s = { f ^ s , i } i = 1 N s o b s \hat{\boldsymbol{f}}_s=\{\hat{f}_{s,i}\}_{i=1}^{N_s^{\mathrm{obs}}} f ^ s = { f ^ s , i } i = 1 N s obs for the fluxes and T s = { T s , i } i = 1 N s o b s \boldsymbol{T}_s=\{T_{s,i}\}_{i=1}^{N_s^{\mathrm{obs}}} T s = { T s , i } i = 1 N s obs for the corresponding observer-frame epochs.
Standard cosmological pipelines generally extract light curve summary statistics by fitting SN Ia SED or light curve models to data using specialised optimisation or sampling algorithms, e.g. SALT (Guy et al. 2007, 2010; Kenworthy et al. 2021), SNooPy (Burns et al. 2011), or BayeSN (Thorp et al. 2021; Mandel et al. 2022; Grayling et al. 2024, 2026a,b). By fitting the SN Ia model to the photometric data and observed heliocentric redshift z ^ s h e l \hat{z}_s^{\mathrm{hel}} z ^ s hel , these algorithms estimate the observed summary parameters d ^ s \hat{\boldsymbol{d}}_s d ^ s . This optimisation frequently employs a maximum likelihood framework, expressed as
arg max d s P ( f ^ s ∣ T s , d s , z ^ s h e l ) → d ^ s , Σ s , (17) \underset{\boldsymbol{d}_s}{\operatorname{arg\,max}}\;P(\hat{\boldsymbol{f}}_s\mid\boldsymbol{T}_s,\boldsymbol{d}_s,\hat{z}_s^{\mathrm{hel}})\to\hat{\boldsymbol{d}}_s,\boldsymbol{\Sigma}_s, \tag*{(17)} d s arg max P ( f ^ s ∣ T s , d s , z ^ s hel ) → d ^ s , Σ s , (17)
where Σ s \boldsymbol{\Sigma}_s Σ s represents the 3 × 3 3\times3 3 × 3 observational covariance matrix capturing the uncertainties and correlations between the estimated parameters. This covariance is typically calculated from the inverse Hessian of the negative log-likelihood function evaluated at the maximum likelihood estimate d ^ s \hat{\boldsymbol{d}}_s d ^ s . Beyond point estimation, alternative strategies for parameter extraction include MCMC (e.g., Mandel et al. 2009) and variational inference (Uzsoy et al. [129 ] ).
Selection
Each survey has a distinct selection function that could depend on the light curve data, summary statistics, heliocentric redshift or other factors. We define an indicator variable
I s = { 0 not selected , 1 selected , (18) I_s=\begin{cases}0 & \text{not selected},\\1 & \text{selected},\end{cases} \tag*{(18)} I s = { 0 1 not selected , selected , (18)
where I s I_s I s specifies whether SN s s s has been selected based on the selection criteria. A SN can fail to be selected either due to falling outside
a given survey’s observational footprint or because the recorded data fails to satisfy the quality cuts. Hereafter, for simplicity, symbols featuring an “obs” subscript or superscript explicitly denote supernovae that are both successfully observed and satisfy these selection cuts. We include an illustration of how survey selection effects influence low redshift and high redshift distributions in Figure 1 .
Figure 1. Illustration of our simulated surveys used in experiments. Two independent surveys are simulated. We first include a low redshift spectroscopic survey and then a high redshift photometric survey, with larger redshift uncertainties and non-Ia contaminants. The top and right panels are the normalised marginal distributions. Both surveys have their own selection function in observed redshift and apparent magnitude space, shown in the marginals with dashed lines.
Classification and Contamination
A photometric analysis that has no spectroscopic confirmation of a SN being of type Ia must consider contamination from non-SN Ia objects such as fast-evolving transients, cataclysmic variables and core-collapse SNe (Vincenzi et al. 2021).
To model the influence of contamination, we consider a true marginal SN Ia fraction over the modelled redshift range before selection, π I a \pi_{\mathrm{Ia}} π Ia . We then use this fraction to parametrise a Bernoulli trial to determine whether an object will be a SN Ia or a contaminant
Q s I a ∼ Bernoulli ( π I a ) (19) Q_s^{\mathrm{Ia}}\sim\operatorname{Bernoulli}(\pi_{\mathrm{Ia}}) \tag*{(19)} Q s Ia ∼ Bernoulli ( π Ia ) (19)
where Q s I a Q_s^{\mathrm{Ia}} Q s Ia acts as an indicator to determine which population parameters are used in the data-generating processes described from Section § 2.1.1 to § 2.3 , such that
( d ^ s , z ^ s ) ∼ { P ( d ^ , z ^ ∣ Θ S N = Θ S N I a , ξ r a t e = ξ r a t e I a , C ) if Q s I a = 1 P ( d ^ , z ^ ∣ Θ S N = Θ S N n o n − I a , ξ r a t e = ξ r a t e n o n − I a , C ) if Q s I a = 0 (20) (\hat{\boldsymbol{d}}_{s},\hat{z}_{s}) \sim
\begin{cases}
P(\hat{\boldsymbol{d}},\hat{z}\mid\Theta_{\mathrm{SN}}=\Theta_{\mathrm{SN}}^{\mathrm{Ia}},\xi_{\mathrm{rate}}=\xi_{\mathrm{rate}}^{\mathrm{Ia}},\boldsymbol{C}) & \text{if } Q_{s}^{\mathrm{Ia}}=1 \\
P(\hat{\boldsymbol{d}},\hat{z}\mid\Theta_{\mathrm{SN}}=\Theta_{\mathrm{SN}}^{\mathrm{non-Ia}},\xi_{\mathrm{rate}}=\xi_{\mathrm{rate}}^{\mathrm{non-Ia}},\boldsymbol{C}) & \text{if } Q_{s}^{\mathrm{Ia}}=0
\end{cases} \tag*{(20)} ( d ^ s , z ^ s ) ∼ { P ( d ^ , z ^ ∣ Θ SN = Θ SN Ia , ξ rate = ξ rate Ia , C ) P ( d ^ , z ^ ∣ Θ SN = Θ SN non − Ia , ξ rate = ξ rate non − Ia , C ) if Q s Ia = 1 if Q s Ia = 0 (20)
For the purpose of generating contaminants in our simulation experiments, we assume that contaminants follow the same general data-generating process as the SNe Ia, but with different population parameters and poor standardisation properties e.g. Θ S N n o n − I a = ( α ≈ 0 , β i n t ≈ 0 , γ ≈ 0 , σ i n t ≈ 1 , … ) \Theta_{\mathrm{SN}}^{\mathrm{non-Ia}}=(\alpha\approx0,\beta_{\mathrm{int}}\approx0,\gamma\approx0,\sigma_{\mathrm{int}}\approx1,\ldots) Θ SN non − Ia = ( α ≈ 0 , β int ≈ 0 , γ ≈ 0 , σ int ≈ 1 , … ) and differing rates. This assumption is not required for inference, since the Bayesian resampling approach in § 2.9 does not construct an explicit contaminant likelihood.
The SNe Ia and contaminants both pass through the type-agnostic selection function defined in § 2.4 , where each object is either selected I s = 1 I_{s}=1 I s = 1 or unselected I s = 0 I_{s}=0 I s = 0 . After selection the objects are all given SN Ia classification scores C s I a = f c l a s s ( X s c l a s s ) ∈ [ 0 , 1 ] C_{s}^{\mathrm{Ia}}=f^{\mathrm{class}}(\boldsymbol{X}_{s}^{\mathrm{class}})\in[0,1] C s Ia = f class ( X s class ) ∈ [ 0 , 1 ] , where the observed classifier inputs X s c l a s s \boldsymbol{X}_{s}^{\mathrm{class}} X s class may include summaries or other data sources such as the light curve (Muthukrishna et al. 2019; Boone 2019; Möller & de Boissière 2020; Qu et al. 2021). We assume the classification score is an estimate of the probability of being an SN Ia given selection and the classification inputs C s I a ≃ P ( Q s I a = 1 ∣ I s = 1 , X s c l a s s ) C_{s}^{\mathrm{Ia}}\simeq P(Q_{s}^{\mathrm{Ia}}=1\mid I_{s}=1,\boldsymbol{X}_{s}^{\mathrm{class}}) C s Ia ≃ P ( Q s Ia = 1 ∣ I s = 1 , X s class ) . In § 2.9 , we describe how we use these classification scores in our FlowSN2 cosmological inference under the influence of contamination.
Posterior Construction
The fundamental change in the new FlowSN2 framework, compared to the Boyd et al. (2026) approach, is the shift from treating SN Ia cosmology as a regression of distance as a function of known (spectroscopic) redshifts, to jointly modelling light curve summary statistics and photometric redshift data within a unified likelihood. In this subsection we will derive this new framework assuming a pure-Ia sample and address class contamination in § 2.9 . A probabilistic graphical model illustrating parameter dependencies is in Figure 2 .
Figure 2. The FlowSN2 graphical model outlining the dependencies between global parameters Θ = ( C , ξ r a t e , M 0 i n t , α , β i n t , τ , R B , γ , σ i n t , θ c i n t , θ x ) \Theta=(C,\xi_{\mathrm{rate}},M_{0}^{\mathrm{int}},\alpha,\beta_{\mathrm{int}},\tau,R_{B},\gamma,\sigma_{\mathrm{int}},\theta_{c}^{\mathrm{int}},\theta_{x}) Θ = ( C , ξ rate , M 0 int , α , β int , τ , R B , γ , σ int , θ c int , θ x ) to be inferred, supernova-level latent variables ( μ s , z s , E s , m 0 s , m s , c s , x s ) (\mu_{s},z_{s},E_{s},m_{0}^{s},m_{s},c_{s},x_{s}) ( μ s , z s , E s , m 0 s , m s , c s , x s ) and observed data shaded in grey ( d ^ s , z s h e l , I s ) (\hat{d}_{s},z_{s}^{\mathrm{hel}},I_{s}) ( d ^ s , z s hel , I s ) . We assume host galaxy masses M s \mathcal{M}_{s} M s , that are determined by galaxy population parameters θ g a l \theta_{\mathrm{gal}} θ gal , are known. Any parameter may be split or conditioned on the host-mass, but here we show it influencing the latent SN magnitude and colour excess for illustration. Similarly, it is trivial to introduce redshift evolution to upstream parameters. The green dashed area highlights the dependencies learnt with the ϕ d 1 1 \phi_{d_{1}}^{1} ϕ d 1 1 normalising flow. This modular SBI framework enables top-level parameters to be defined explicitly, while lower-level latents within the green bounds are marginalised implicitly. Deciding which latent parameters are captured by the flow is a design choice guided by practical convenience. Each parameter is clearly defined in § 2 . Note, we only have observed data for selected SNe with I s = 1 I_{s}=1 I s = 1 and train the normalising flows using only these examples.
The posterior of the global parameters of interest Θ = ( Θ S N , ξ r a t e , C ) \Theta=(\Theta_{\mathrm{SN}},\xi_{\mathrm{rate}},\boldsymbol{C}) Θ = ( Θ SN , ξ rate , C ) conditioned on all the data, framed as a joint inference problem, is
P ( Θ ∣ D ^ o b s , Z ^ o b s , I o b s ) ∝ P ( D ^ o b s , Z ^ o b s ∣ I o b s , Θ ) P ( Θ ∣ I o b s ) , (21) P(\Theta\mid\hat{\boldsymbol{D}}_{\mathrm{obs}},\hat{\boldsymbol{Z}}_{\mathrm{obs}},\boldsymbol{I}_{\mathrm{obs}})\propto P(\hat{\boldsymbol{D}}_{\mathrm{obs}},\hat{\boldsymbol{Z}}_{\mathrm{obs}}\mid\boldsymbol{I}_{\mathrm{obs}},\Theta)P(\Theta\mid\boldsymbol{I}_{\mathrm{obs}}), \tag*{(21)} P ( Θ ∣ D ^ obs , Z ^ obs , I obs ) ∝ P ( D ^ obs , Z ^ obs ∣ I obs , Θ ) P ( Θ ∣ I obs ) , (21)
where D ^ o b s = { d ^ s } s = 1 N S N o b s \hat{\boldsymbol{D}}_{\mathrm{obs}}=\{\hat{\boldsymbol{d}}_{s}\}_{s=1}^{N_{\mathrm{SN}}^{\mathrm{obs}}} D ^ obs = { d ^ s } s = 1 N SN obs denotes the observed summary statistics for the selected sample and Z ^ o b s = { z ^ s } s = 1 N S N o b s \hat{\boldsymbol{Z}}_{\mathrm{obs}}=\{\hat{z}_{s}\}_{s=1}^{N_{\mathrm{SN}}^{\mathrm{obs}}} Z ^ obs = { z ^ s } s = 1 N SN obs denotes the redshift measurements associated with the selected SNe. The selected sample is represented by the indicator vector of ones I o b s = { I s = 1 } s = 1 N S N o b s \boldsymbol{I}_{\mathrm{obs}}=\{I_{s}=1\}_{s=1}^{N_{\mathrm{SN}}^{\mathrm{obs}}} I obs = { I s = 1 } s = 1 N SN obs . The combined data likelihood across all the observed SNe is denoted by P ( D ^ o b s , Z ^ o b s ∣ I o b s , Θ ) P(\hat{\boldsymbol{D}}_{\mathrm{obs}},\hat{\boldsymbol{Z}}_{\mathrm{obs}}\mid\boldsymbol{I}_{\mathrm{obs}},\Theta) P ( D ^ obs , Z ^ obs ∣ I obs , Θ ) . Our posterior and likelihood are conditioned on light curve summary fit covariance Σ s \Sigma_{s} Σ s and photometric redshift uncertainties σ z , s \sigma_{z,s} σ z , s , though we suppress them in our notation here and throughout. The prior on our global parameters P ( Θ ∣ I o b s ) P(\Theta\mid\boldsymbol{I}_{\mathrm{obs}}) P ( Θ ∣ I obs ) includes C \boldsymbol{C} C , conditioned on only the selected SNe1 {}^{1} 1 I o b s \boldsymbol{I}_{\mathrm{obs}} I obs . We also make the approximation that P ( Θ ∣ I o b s ) ≈ P ( Θ ) P(\Theta\mid\boldsymbol{I}_{\mathrm{obs}})\approx P(\Theta) P ( Θ ∣ I obs ) ≈ P ( Θ ) , implying that the number of selected SNe is non-informative for the global parameters, including cosmological parameters. This neglects the weak constraining power one can gain from selected SN counts which have been incorporated in other models (Karchev & Trotta 2025).
The combined data likelihood for the N S N o b s N_{\mathrm{SN}}^{\mathrm{obs}} N SN obs selected SNe is written as the product of the individual observed SN data likelihoods, such that
P ( D ^ o b s , Z ^ o b s ∣ I o b s , Θ ) = ∏ s = 1 N S N o b s P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) . (22) P(\hat{\boldsymbol{D}}_{\mathrm{obs}},\hat{\boldsymbol{Z}}_{\mathrm{obs}}\mid\boldsymbol{I}_{\mathrm{obs}},\Theta)=\prod_{s=1}^{N_{\mathrm{SN}}^{\mathrm{obs}}}P(\hat{\boldsymbol{d}}_{s},\hat{z}_{s}\mid I_{s}=1,\Theta). \tag*{(22)} P ( D ^ obs , Z ^ obs ∣ I obs , Θ ) = s = 1 ∏ N SN obs P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) . (22)
Each SN’s observed data are assumed to be conditionally independent of those of other SNe. We also assume that the selection probability for a given SN is conditionally independent of the selection of the others. There may be some covariance systematics between SNe, however, these relationships can be incorporated as conditional likelihood information to maintain the hierarchical structure of the model.
We split the observed data likelihood into cosmology conditionally independent and cosmology-dependent components, whilst marginalising over the true latent redshift and CMB-frame distance modulus such that
P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) = ∫ − ∞ ∞ ∫ 0 ∞ P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ S N ) × P ( μ s , z s ∣ I s = 1 , Θ S N , ξ r a t e , C ) d z s d μ s (23) P(\hat{\mathbf{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}) =
\int_{-\infty}^{\infty}\int_0^{\infty}
P(\hat{\mathbf{d}}_s,\hat{z}_s\mid I_s=1,\mu_s,z_s,\boldsymbol{\Theta}_{\rm SN})
\times P(\mu_s,z_s\mid I_s=1,\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate},\mathbf{C})\,\mathrm{d}z_s\mathrm{d}\mu_s \tag*{(23)} P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) = ∫ − ∞ ∞ ∫ 0 ∞ P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ SN ) × P ( μ s , z s ∣ I s = 1 , Θ SN , ξ rate , C ) d z s d μ s (23)
where we have used the fact that, given μ s \mu_s μ s and z s z_s z s , the observed data are conditionally independent of the cosmological and rate parameters. Since the CMB-frame distance modulus is a deterministic function of the true redshift, μ s = μ ( z s ; C ) \mu_s=\mu(z_s;\mathbf{C}) μ s = μ ( z s ; C ) , the second factor in the integrand is P ( μ s , z s ∣ I s = 1 , Θ ) = δ D ( μ s − μ ( z s ; C ) ) P ( z s ∣ I s = 1 , Θ ) P(\mu_s,z_s\mid I_s=1,\boldsymbol{\Theta})=\delta_{\rm D}(\mu_s-\mu(z_s;\mathbf{C}))P(z_s\mid I_s=1,\boldsymbol{\Theta}) P ( μ s , z s ∣ I s = 1 , Θ ) = δ D ( μ s − μ ( z s ; C )) P ( z s ∣ I s = 1 , Θ ) and the marginalisation collapses into a one-dimensional integral
P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) = ∫ 0 ∞ P ( d ^ s , z ^ s ∣ I s = 1 , μ ( z s ; C ) , z s , Θ S N ) × P ( z s ∣ I s = 1 , Θ S N , ξ r a t e , C ) d z s . (24) P(\hat{\mathbf{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}) =
\int_0^{\infty}
P(\hat{\mathbf{d}}_s,\hat{z}_s\mid I_s=1,\mu(z_s;\mathbf{C}),z_s,\boldsymbol{\Theta}_{\rm SN})
\times P(z_s\mid I_s=1,\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate},\mathbf{C})\,\mathrm{d}z_s . \tag*{(24)} P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) = ∫ 0 ∞ P ( d ^ s , z ^ s ∣ I s = 1 , μ ( z s ; C ) , z s , Θ SN ) × P ( z s ∣ I s = 1 , Θ SN , ξ rate , C ) d z s . (24)
Following a similar approach to Boyd et al. (2026), we define the cosmological model conditionally independent data likelihood using an auxiliary density g 1 g_1 g 1
P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ S N ) = g 1 ( d ^ s , z ^ s ∣ m 0 i n t = M 0 i n t + μ s + γ δ M , z s , Σ s , σ z , s , Θ S N ) . (25) P(\hat{\mathbf{d}}_s,\hat{z}_s\mid I_s=1,\mu_s,z_s,\boldsymbol{\Theta}_{\rm SN})
= g_1(\hat{\mathbf{d}}_s,\hat{z}_s\mid m_0^{\rm int}=M_0^{\rm int}+\mu_s+\gamma\delta_M,z_s,\boldsymbol{\Sigma}_s,\sigma_{z,s},\boldsymbol{\Theta}_{\rm SN}). \tag*{(25)} P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ SN ) = g 1 ( d ^ s , z ^ s ∣ m 0 int = M 0 int + μ s + γ δ M , z s , Σ s , σ z , s , Θ SN ) . (25)
We then use a first normalising flow q 1 ϕ 1 q_1^{\phi_1} q 1 ϕ 1 with learnable parameters ϕ 1 \boldsymbol{\phi}_1 ϕ 1 as a flexible density estimator (Tabak & Vanden-Eijnden 2010; Tabak & Turner 2013) to approximate g 1 g_1 g 1
g 1 ( d ^ , z ^ ∣ m 0 , z , Σ , σ z , Θ S N ) ≈ q 1 ϕ 1 ( d ^ , z ^ ∣ ψ 1 ) (26) g_1(\hat{\mathbf{d}},\hat{z}\mid m_0,z,\boldsymbol{\Sigma},\sigma_z,\boldsymbol{\Theta}_{\rm SN})\approx q_1^{\phi_1}(\hat{\mathbf{d}},\hat{z}\mid\boldsymbol{\psi}_1) \tag*{(26)} g 1 ( d ^ , z ^ ∣ m 0 , z , Σ , σ z , Θ SN ) ≈ q 1 ϕ 1 ( d ^ , z ^ ∣ ψ 1 ) (26)
where ψ 1 = ( m 0 , z , Σ , σ z , Θ S N ) \boldsymbol{\psi}_1=(m_0,z,\boldsymbol{\Sigma},\sigma_z,\boldsymbol{\Theta}_{\rm SN}) ψ 1 = ( m 0 , z , Σ , σ z , Θ SN ) . Details of q 1 ϕ 1 q_1^{\phi_1} q 1 ϕ 1 training using simulations are provided in Section 2.6.2.
The cosmology-dependent latent redshift distribution of the selected SNe follows from Bayes’ theorem,
P ( z s ∣ I s = 1 , Θ S N , ξ r a t e , C ) = P ( I s = 1 ∣ μ ( z s ; C ) , z s , Θ S N ) P ( z s ∣ ξ r a t e , C ) ∫ 0 ∞ P ( I s = 1 ∣ μ ( z ; C ) , z , Θ S N ) P ( z ∣ ξ r a t e , C ) d z = w ˉ ( z s ) P ( z s ∣ ξ r a t e , C ) ∫ 0 ∞ w ˉ ( z ) P ( z ∣ ξ r a t e , C ) d z P(z_s\mid I_s=1,\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate},\mathbf{C})
=
\frac{P(I_s=1\mid\mu(z_s;\mathbf{C}),z_s,\boldsymbol{\Theta}_{\rm SN})P(z_s\mid\boldsymbol{\xi}_{\rm rate},\mathbf{C})}
{\int_0^{\infty}P(I_s=1\mid\mu(z;\mathbf{C}),z,\boldsymbol{\Theta}_{\rm SN})P(z\mid\boldsymbol{\xi}_{\rm rate},\mathbf{C})\,\mathrm{d}z}
=
\frac{\bar{w}(z_s)P(z_s\mid\boldsymbol{\xi}_{\rm rate},\mathbf{C})}
{\int_0^{\infty}\bar{w}(z)P(z\mid\boldsymbol{\xi}_{\rm rate},\mathbf{C})\,\mathrm{d}z} P ( z s ∣ I s = 1 , Θ SN , ξ rate , C ) = ∫ 0 ∞ P ( I s = 1 ∣ μ ( z ; C ) , z , Θ SN ) P ( z ∣ ξ rate , C ) d z P ( I s = 1 ∣ μ ( z s ; C ) , z s , Θ SN ) P ( z s ∣ ξ rate , C ) = ∫ 0 ∞ w ˉ ( z ) P ( z ∣ ξ rate , C ) d z w ˉ ( z s ) P ( z s ∣ ξ rate , C )
where
w ˉ ( z s ) = P ( I s = 1 ∣ μ ( z s ; C ) , z s , Θ S N ) P ( I s = 1 ∣ Θ S N , ξ r a t e = 1.5 , C = C 1 ) = P ( μ ( z s ; C ) , z s ∣ I s = 1 , Θ S N , ξ r a t e = 1.5 , C = C 1 ) P ( μ ( z s ; C ) , z s ∣ ξ r a t e = 1.5 , C = C 1 ) (27) \bar{w}(z_s)=\frac{P(I_s=1\mid\mu(z_s;\mathbf{C}),z_s,\boldsymbol{\Theta}_{\rm SN})}{P(I_s=1\mid\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1)}
=
\frac{P(\mu(z_s;\mathbf{C}),z_s\mid I_s=1,\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1)}
{P(\mu(z_s;\mathbf{C}),z_s\mid\boldsymbol{\xi}_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1)} \tag*{(27)} w ˉ ( z s ) = P ( I s = 1 ∣ Θ SN , ξ rate = 1.5 , C = C 1 ) P ( I s = 1 ∣ μ ( z s ; C ) , z s , Θ SN ) = P ( μ ( z s ; C ) , z s ∣ ξ rate = 1.5 , C = C 1 ) P ( μ ( z s ; C ) , z s ∣ I s = 1 , Θ SN , ξ rate = 1.5 , C = C 1 ) (27)
where we have used the observation that the selection probability P ( I s = 1 ∣ μ s , z s , Θ S N , ξ r a t e , C ) ≡ P ( I s = 1 ∣ μ s , z s , Θ S N ) P(I_s=1\mid\mu_s,z_s,\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate},\mathbf{C})\equiv P(I_s=1\mid\mu_s,z_s,\boldsymbol{\Theta}_{\rm SN}) P ( I s = 1 ∣ μ s , z s , Θ SN , ξ rate , C ) ≡ P ( I s = 1 ∣ μ s , z s , Θ SN ) is conditionally independent of cosmological and rate parameters given μ s \mu_s μ s and z s z_s z s are known. The selection probability is therefore a property of the survey alone, shared by every cosmology, and the second equality follows by applying Bayes’ theorem under a fiducial cosmology C 1 \mathbf{C}_1 C 1 and fiducial rate ξ r a t e = 1.5 \boldsymbol{\xi}_{\rm rate}=1.5 ξ rate = 1.5 . Note that the constant P ( I s = 1 ∣ Θ S N , ξ r a t e = 1.5 , C = C 1 ) P(I_s=1\mid\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1) P ( I s = 1 ∣ Θ SN , ξ rate = 1.5 , C = C 1 ) cancels between the numerator and denominator of Eq. (27) and never needs to be evaluated. Rather than implement a classifier to approximate the selection probability, we instead approximate P ( μ s , z s ∣ I s = 1 , Θ S N , ξ r a t e = 1.5 , C = C 1 ) P(\mu_s,z_s\mid I_s=1,\boldsymbol{\Theta}_{\rm SN},\boldsymbol{\xi}_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1) P ( μ s , z s ∣ I s = 1 , Θ SN , ξ rate = 1.5 , C = C 1 ) directly, and evaluate P ( μ s , z s ∣ ξ r a t e = 1.5 , C = C 1 ) P(\mu_s,z_s\mid\xi_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1) P ( μ s , z s ∣ ξ rate = 1.5 , C = C 1 ) analytically using Eq. (1) .
We define the latent redshift–distance modulus distribution for selected SNe using a second auxiliary density g 2 g_2 g 2
P ( μ s , z s ∣ I s = 1 , Θ S N , ξ r a t e = 1.5 , C = C 1 ) = g 2 ( Δ μ s , z s ∣ Θ S N ) (28) P(\mu_s,z_s\mid I_s=1,\boldsymbol{\Theta}_{\rm SN},\xi_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1)
= g_2(\Delta\mu_s,z_s\mid\boldsymbol{\Theta}_{\rm SN}) \tag*{(28)} P ( μ s , z s ∣ I s = 1 , Θ SN , ξ rate = 1.5 , C = C 1 ) = g 2 ( Δ μ s , z s ∣ Θ SN ) (28)
where Δ μ s = μ s + M 0 i n t + γ δ M s − M 0 , f i d i n t − μ ( z s ; C = C 1 ) \Delta\mu_s=\mu_s+M_0^{\rm int}+\gamma\delta M^s-M_{0,\rm fid}^{\rm int}-\mu(z_s;\mathbf{C}=\mathbf{C}_1) Δ μ s = μ s + M 0 int + γ δ M s − M 0 , fid int − μ ( z s ; C = C 1 ) is the magnitude zero-point of the SN relative to its fiducial value. We then use a second normalising flow q 2 ϕ 2 q_2^{\phi_2} q 2 ϕ 2 with learnable parameters ϕ 2 \phi_2 ϕ 2 as a flexible density estimator to approximate g 2 g_2 g 2
g 2 ( Δ μ , z ∣ Θ S N ) ≈ q 2 ϕ 2 ( Δ μ , z ∣ Θ S N ) (29) g_2(\Delta\mu,z\mid\boldsymbol{\Theta}_{\rm SN})\approx q_2^{\phi_2}(\Delta\mu,z\mid\boldsymbol{\Theta}_{\rm SN}) \tag*{(29)} g 2 ( Δ μ , z ∣ Θ SN ) ≈ q 2 ϕ 2 ( Δ μ , z ∣ Θ SN ) (29)
When simulating the training set we scatter the distance modulus about its fiducial value, μ t = μ ( z t ; C 1 ) + ε t μ \mu_t=\mu(z_t;\mathbf{C}_1)+\varepsilon_t^\mu μ t = μ ( z t ; C 1 ) + ε t μ with ε t μ ∼ N ( 0 , σ μ 2 ) \varepsilon_t^\mu\sim N(0,\sigma_\mu^2) ε t μ ∼ N ( 0 , σ μ 2 ) and σ μ ≈ 0.25 \sigma_\mu\approx0.25 σ μ ≈ 0.25 , before applying the survey selection. Without this scatter the simulated pairs ( μ t , z t ) (\mu_t,z_t) ( μ t , z t ) would all lie on the single curve μ t = μ ( z t ; C 1 ) \mu_t=\mu(z_t;\mathbf{C}_1) μ t = μ ( z t ; C 1 ) , and q 2 ϕ 2 q_2^{\phi_2} q 2 ϕ 2 could not be evaluated away from it. The scatter instead gives support over ( μ s , z s ) (\mu_s,z_s) ( μ s , z s ) pairs away from the fiducial cosmology at inference time, as the trial values of C \mathbf{C} C , M 0 i n t M_0^{\rm int} M 0 int and γ \gamma γ vary. All alternative cosmologies that lie in the broadened training distribution have support. The scatter must also be accounted for in the normalisation of w ˉ ( z s ) \bar{w}(z_s) w ˉ ( z s ) , such that
P ( μ s , z s ∣ ξ r a t e = 1.5 , C = C 1 ) ≈ N ( Δ μ s ∣ 0 , σ μ 2 ) P ( z s ∣ ξ r a t e = 1.5 , C = C 1 ) . (30) P(\mu_s,z_s\mid\xi_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1)
\approx N(\Delta\mu_s\mid0,\sigma_\mu^2)P(z_s\mid\xi_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1). \tag*{(30)} P ( μ s , z s ∣ ξ rate = 1.5 , C = C 1 ) ≈ N ( Δ μ s ∣ 0 , σ μ 2 ) P ( z s ∣ ξ rate = 1.5 , C = C 1 ) . (30)
Further details on the training of q 2 ϕ 2 q_2^{\phi_2} q 2 ϕ 2 are in Section 2.6.3.
The joint SN data likelihood used in FlowSN2 in practice is therefore
P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) ≈ ∫ 0 ∞ q 1 ϕ 1 ( d ^ s , z ^ s ∣ ψ s 1 ) w ˉ ( z s ) P ( z s ∣ ξ r a t e , C ) d z s ∫ 0 ∞ w ˉ ( z s ) P ( z s ∣ ξ r a t e , C ) d z s P(\hat{\mathbf{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta})
\approx
\frac{\int_0^\infty q_1^{\phi_1}(\hat{\mathbf{d}}_s,\hat{z}_s\mid\boldsymbol{\psi}_s^1)\bar{w}(z_s)P(z_s\mid\xi_{\rm rate},\mathbf{C})\,\mathrm{d}z_s}
{\int_0^\infty\bar{w}(z_s)P(z_s\mid\xi_{\rm rate},\mathbf{C})\,\mathrm{d}z_s} P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) ≈ ∫ 0 ∞ w ˉ ( z s ) P ( z s ∣ ξ rate , C ) d z s ∫ 0 ∞ q 1 ϕ 1 ( d ^ s , z ^ s ∣ ψ s 1 ) w ˉ ( z s ) P ( z s ∣ ξ rate , C ) d z s
where w ˉ ( z s ) ≈ \bar{w}(z_s)\approx w ˉ ( z s ) ≈
q 2 ϕ 2 ( Δ μ s , z s ∣ Θ S N ) N ( Δ μ s ∣ 0 , σ μ 2 ) P ( z s ∣ ξ r a t e = 1.5 , C = C 1 ) (31) \frac{q_2^{\phi_2}(\Delta\mu_s,z_s\mid\boldsymbol{\Theta}_{\rm SN})}
{N(\Delta\mu_s\mid0,\sigma_\mu^2)P(z_s\mid\xi_{\rm rate}=1.5,\mathbf{C}=\mathbf{C}_1)} \tag*{(31)} N ( Δ μ s ∣ 0 , σ μ 2 ) P ( z s ∣ ξ rate = 1.5 , C = C 1 ) q 2 ϕ 2 ( Δ μ s , z s ∣ Θ SN ) (31)
where both one-dimensional integrals are numerically computed using the trapezium rule. Figure 3 illustrates the distributions our normalising flows learn and how they interact in the framework.
Figure 3. Illustration of the FlowSN2 pipeline. The first normalising flow q 1 ϕ 1 q_1^{\phi_1} q 1 ϕ 1 learns the observed light curve summary statistics ( m ^ s , c ^ s , x ^ s ) (\hat{m}_s,\hat{c}_s,\hat{x}_s) ( m ^ s , c ^ s , x ^ s ) and observed redshifts z ^ s \hat{z}_s z ^ s distributions under the influence of selection effects, conditioned on the latent redshift z s z_s z s and distance modulus μ s \mu_s μ s . The second normalising flow q 2 ϕ 2 q_2^{\phi_2} q 2 ϕ 2 learns the latent redshift and distance modulus distribution under the influence of selection. The latent redshift distribution under the influence of selection decreases at higher redshifts as Malmquist bias takes effect. The learnt q 2 ϕ 2 q_2^{\phi_2} q 2 ϕ 2 represents a noisy Hubble diagram centred around a fiducial cosmology C f i d \mathbf{C}_{\rm fid} C fid (dashed line), where the introduction of the noise allows us to have support over other sets of cosmological parameters C ′ \mathbf{C}' C ′ (solid line) beyond the fiducial standard Λ \Lambda Λ CDM model. To emphasise the influence of selection, we also show the distributions of the unselected SNe in grey. Both normalising flows are trained using survey simulations, then are subsequently used during inference in Hamiltonian Monte Carlo sampling of the posterior on cosmological parameters and other SN population parameters of interest.
Combining Surveys
In practice, we have SNe from several distinct surveys, each with its own selection function and its own measurement uncertainties. In the simulated experiments that follow we use two surveys, a low-redshift spectroscopic sample and a high-redshift photometric one, but the treatment below applies to any number. We index the surveys by j = 1 , … , N s u r v j=1,\ldots,N_{\rm surv} j = 1 , … , N surv , and write d ^ s j \hat{\mathbf{d}}_s^j d ^ s j , z ^ s j \hat{z}_s^j z ^ s j and I s j I_s^j I s j for the summary statistics, redshift measurement and selection indicator of the s s s th SN of survey j j j , of which N o b s j N_{\rm obs}^j N obs j are selected.
The global parameters Θ = ( Θ S N , ξ r a t e , C ) \boldsymbol{\Theta}=(\boldsymbol{\Theta}_{\rm SN},\xi_{\rm rate},\mathbf{C}) Θ = ( Θ SN , ξ rate , C ) are shared by every survey. The cosmology, the SN population and the volumetric rate are properties of the Universe rather than of any instrument, and it is precisely this sharing that allows the surveys to be combined informatively. What differs between surveys is the selection function and the observational uncertainties.
Conditioned on Θ \boldsymbol{\Theta} Θ , the observed data of a SN in one survey are independent of those of a SN in any other, and the selection of a given SN is independent of the selection of the others both within and across surveys. The combined data likelihood is therefore the product over surveys of the per-survey likelihoods, each of which is itself the product over that survey’s selected SNe,
P ( D ^ o b s , Z ^ o b s ∣ I o b s , Θ ) = ∏ j = 1 N s u r v ∏ s = 1 N o b s j P ( d ^ s j , z ^ s j ∣ I s j = 1 , Θ ) , (32) P(\hat{\mathbf{D}}_{\rm obs},\hat{\mathbf{Z}}_{\rm obs}\mid\mathbf{I}_{\rm obs},\boldsymbol{\Theta})
=\prod_{j=1}^{N_{\rm surv}}\prod_{s=1}^{N_{\rm obs}^j}
P(\hat{\mathbf{d}}_s^j,\hat{z}_s^j\mid I_s^j=1,\boldsymbol{\Theta}), \tag*{(32)} P ( D ^ obs , Z ^ obs ∣ I obs , Θ ) = j = 1 ∏ N surv s = 1 ∏ N obs j P ( d ^ s j , z ^ s j ∣ I s j = 1 , Θ ) , (32)
which is Eq. (22) with the product over the full sample split into a product over surveys. Each factor of Eq. (32) takes the form derived in § 2.6 . Since both auxiliary densities are conditional on selection, we train two normalising flows per survey, q 1 ϕ 1 j q_1^{\phi_1^j} q 1 ϕ 1 j and q 2 ϕ 2 j q_2^{\phi_2^j} q 2 ϕ 2 j , with learnable parameters ϕ 1 j \phi_1^j ϕ 1 j and ϕ 2 j \phi_2^j ϕ 2 j , and the importance weight becomes survey-dependent, w ˉ j ( z s ) \bar{w}_j(z_s) w ˉ j ( z s ) .
Bayesian Evidence for Model Selection
We re-use our FlowSN2 formulation (without retraining our normalising flows) to calculate the Bayesian evidence for model selection. The evidence is defined as
P ( D ^ o b s , Z ^ o b s ∣ I o b s , M 1 ) = ∫ P ( D ^ o b s , Z ^ o b s ∣ I o b s , Θ , M 1 ) P ( Θ ∣ I o b s , M 1 ) d Θ (33) P(\hat{\mathbf{D}}_{\rm obs},\hat{\mathbf{Z}}_{\rm obs}\mid\mathbf{I}_{\rm obs},\mathcal{M}_1)
=\int P(\hat{\mathbf{D}}_{\rm obs},\hat{\mathbf{Z}}_{\rm obs}\mid\mathbf{I}_{\rm obs},\boldsymbol{\Theta},\mathcal{M}_1)P(\boldsymbol{\Theta}\mid\mathbf{I}_{\rm obs},\mathcal{M}_1)\,\mathrm{d}\boldsymbol{\Theta} \tag*{(33)} P ( D ^ obs , Z ^ obs ∣ I obs , M 1 ) = ∫ P ( D ^ obs , Z ^ obs ∣ I obs , Θ , M 1 ) P ( Θ ∣ I obs , M 1 ) d Θ (33)
where we include the implicit conditioning on our assumed model M 1 \mathcal{M}_1 M 1 . Here we assume P ( Θ ∣ I o b s , M 1 ) = P ( Θ ∣ M 1 ) P(\boldsymbol{\Theta}\mid\mathbf{I}_{\rm obs},\mathcal{M}_1)=P(\boldsymbol{\Theta}\mid\mathcal{M}_1) P ( Θ ∣ I obs , M 1 ) = P ( Θ ∣ M 1 ) , implying that the number of selected SNe is non-informative for the global parameters, including cosmological parameters, as done in Eq. (21) . Our priors must also be proper so we can integrate over the full prior volume. Since we marginalise over latent parameters, leaving ≈ 15 \approx15 ≈ 15 global parameters, we can practically calculate the evidence of our model with modern sampling codes (Handley et al. 2015a,b; Buchner 2021; Ashton et al. 2022).
It is then helpful to compare evidence ratios of differing models using Bayes factors
B F 1 , 0 = P ( D ^ o b s , Z ^ o b s ∣ I o b s , M 1 ) P ( D ^ o b s , Z ^ o b s ∣ I o b s , M 0 ) , (34) \mathrm{BF}_{1,0}=
\frac{P(\hat{\mathbf{D}}_{\rm obs},\hat{\mathbf{Z}}_{\rm obs}\mid\mathbf{I}_{\rm obs},\mathcal{M}_1)}
{P(\hat{\mathbf{D}}_{\rm obs},\hat{\mathbf{Z}}_{\rm obs}\mid\mathbf{I}_{\rm obs},\mathcal{M}_0)}, \tag*{(34)} BF 1 , 0 = P ( D ^ obs , Z ^ obs ∣ I obs , M 0 ) P ( D ^ obs , Z ^ obs ∣ I obs , M 1 ) , (34)
where the assumed generative models, M 0 \mathcal{M}_0 M 0 and M 1 \mathcal{M}_1 M 1 , may differ, for example choosing the Simple-Bayesian SN (Mandel et al. 2017) parameterisation to explicitly model dust over the standard Tripp (1998) formula. One can interpret the ratios to determine whether the data favours one model over the other using the Jeffreys’ scale (Jeffreys 1961). We note that Bayes factors can be sensitive to the choice and width of parameters priors, so in practice these should be varied before model comparison results are declared.
In the special case of comparing a null hypothesis model M 0 \mathcal{M}_0 M 0 , that is nested within a more complex model M 1 \mathcal{M}_1 M 1 with identical priors on mutual parameters, we may use the Savage-Dickey density ratio (Dickey 1971) such that
B F 1 , 0 = P ( θ = θ 0 ∣ I o b s , M 1 ) P ( θ = θ 0 ∣ D ^ o b s , Z ^ o b s , I o b s , M 1 ) , (35) \mathrm{BF}_{1,0}=
\frac{P(\theta=\theta_0\mid\mathbf{I}_{\rm obs},\mathcal{M}_1)}
{P(\theta=\theta_0\mid\hat{\mathbf{D}}_{\rm obs},\hat{\mathbf{Z}}_{\rm obs},\mathbf{I}_{\rm obs},\mathcal{M}_1)}, \tag*{(35)} BF 1 , 0 = P ( θ = θ 0 ∣ D ^ obs , Z ^ obs , I obs , M 1 ) P ( θ = θ 0 ∣ I obs , M 1 ) , (35)
where θ \theta θ is a parameter that is freely inferred in the complex model M 1 \mathcal{M}_1 M 1 , but held constant at θ 0 \theta_0 θ 0 in the nested null model M 0 \mathcal{M}_0 M 0 . The term P ( θ = θ 0 ∣ D ^ o b s , Z ^ o b s , I o b s , M 1 ) P(\theta=\theta_0\mid\hat{\mathbf{D}}_{\rm obs},\hat{\mathbf{Z}}_{\rm obs},\mathbf{I}_{\rm obs},\mathcal{M}_1) P ( θ = θ 0 ∣ D ^ obs , Z ^ obs , I obs , M 1 ) is the marginal posterior density evaluated at θ 0 \theta_0 θ 0 , while P ( θ = θ 0 ∣ I o b s , M 1 ) P(\theta=\theta_0\mid\mathcal{I}_{\rm obs},\mathcal{M}_1) P ( θ = θ 0 ∣ I obs , M 1 ) represents the marginal prior density evaluated at θ 0 \theta_0 θ 0 . This property is particularly convenient in the case of our SN analysis as it makes use of our precomputed M 1 \mathcal{M}_1 M 1 posteriors. Furthermore, there are several nested model comparisons of interest. For example, we can evaluate whether dark energy is evolving (w a ≠ 0 w_a \ne0 w a = 0 ) versus constant (w a = 0 w_a = 0 w a = 0 ), as well as testing for the presence of an intrinsic host-galaxy mass-step (γ ≠ 0 \gamma\ne0 γ = 0 versus γ = 0 \gamma= 0 γ = 0 ) against extrinsic differences in dust. In § 3.5 , we demonstrate that FlowSN2 is able to identify the correct data-generating model using the Savage–Dickey density ratio, whilst incurring negligible additional computational cost.
Modular Bayesian Inference under Contamination
In this subsection, we outline how we make inferences under the influence of non-Ia contamination in our sample. We utilise the modular3 Bayesian approach proposed by Autenrieth et al. (2026). This approach is particularly convenient as it does not require an explicit likelihood for the suspect component, here the non-Ia population, protecting downstream inference from potentially misspecified contaminant models while propagating classification uncertainty. We note that the FlowSN2 framework is also compatible with a BEAMS-like mixture model approach (Kunz et al. 2007), although this would require an explicit contaminant likelihood and could bias inference if that likelihood is misspecified. Below, we outline the modular Bayesian resampling procedure adopted in FlowSN2 and refer the reader to Autenrieth et al. (2026) for its theoretical development and empirical validation.
We adopt the two modular interventions proposed by Autenrieth et al. (2026) to protect inference on parameters of scientific interest from potentially misspecified mixture components. First, classification scores obtained from the classifier f c l a s s ( X s c l a s s ) → C s I a f^{\mathrm{class}}(\mathbf{X}^{\mathrm{class}}_{\mathrm{s}}) \to C^{\mathrm{Ia}}_{\mathrm{s}} f class ( X s class ) → C s Ia , defined in § 2.5 , are held fixed during downstream inference, preventing feedback from the scientific model into classification. Here, X s c l a s s \mathbf{X}^{\mathrm{class}}_{\mathrm{s}} X s class denotes the observed information used for classification, which includes summary statistics d ^ s \hat{\mathbf{d}}_{\mathrm{s}} d ^ s and redshifts z ^ s \hat{z}_{\mathrm{s}} z ^ s , and may also include additional data such as light curve data. Classification scores may be obtained from classifiers trained on representative labelled observations or simulations, provided their calibration is appropriate for the target survey, which can be assessed using representative labelled observations where available. The classification scores need not recover the exact conditional class probabilities. A sufficient condition is that, among selected SNe with similar observed light curve summaries and redshifts, the average matches the true fraction of SNe Ia. Under this condition, the method can recover the same cosmological and SN Ia population parameter values as an analysis with known SN types in sufficiently large samples (Autenrieth et al. 2026). Second, we treat the non-Ia population as a suspect component, since a misspecified contaminant likelihood could bias inference. We therefore exclude its likelihood contributions from the downstream analysis, restricting inference to the trusted SN Ia model, at the potential cost of information that a correctly specified contaminant model could provide. Together, these interventions substantially simplify the computational treatment of contamination by allowing us to reuse the existing SN Ia inference framework across sampled class allocations, as described below.
We resample M M M independent class allocations, each assigning a binary label to every selected (I s = 1 I_{\mathrm{s}} = 1 I s = 1 ) object according to its classification score C s I a C^{\mathrm{Ia}}_{\mathrm{s}} C s Ia
L s m ∼ Bernoulli ( C s I a ) for s = 1 , … , N S N o b s and m = 1 , … , M , (36) L^{m}_{\mathrm{s}} \sim\operatorname{Bernoulli}(C^{\mathrm{Ia}}_{\mathrm{s}}) \quad\text{for } s = 1,\ldots,N_{\mathrm{SN}}^{\mathrm{obs}} \text{ and } m = 1,\ldots,M, \tag*{(36)} L s m ∼ Bernoulli ( C s Ia ) for s = 1 , … , N SN obs and m = 1 , … , M , (36)
The indicator L s m = 1 L^{m}_{\mathrm{s}} = 1 L s m = 1 signals that object s s s is retained in the SN Ia analysis, while L s m = 0 L^{m}_{\mathrm{s}} = 0 L s m = 0 indicates that object s s s is excluded for allocation m m m . The data used in allocation m m m are therefore
D ^ m = { d ^ s : L s m = 1 } , Z ^ m = { z ^ s : L s m = 1 } , I m = { I s : L s m = 1 } . \hat{\mathbf{D}}^{m} = \{\hat{\mathbf{d}}_{\mathrm{s}} : L^{m}_{\mathrm{s}} = 1\}, \quad\hat{\mathbf{Z}}^{m} = \{\hat{z}_{\mathrm{s}} : L^{m}_{\mathrm{s}} = 1\}, \quad\mathbf{I}^{m} = \{I_{\mathrm{s}} : L^{m}_{\mathrm{s}} = 1\}. D ^ m = { d ^ s : L s m = 1 } , Z ^ m = { z ^ s : L s m = 1 } , I m = { I s : L s m = 1 } .
Following Autenrieth et al. (2026), the modular Bayesian posterior P ′ ( Θ ∣ D ^ o b s , Z ^ o b s , I o b s ) P'(\boldsymbol{\Theta} \mid\hat{\mathbf{D}}_{\mathrm{obs}}, \hat{\mathbf{Z}}_{\mathrm{obs}}, \mathbf{I}_{\mathrm{obs}}) P ′ ( Θ ∣ D ^ obs , Z ^ obs , I obs ) is approximated by averaging the normalised posteriors of Eq. (21) over the M M M resampled label allocations
P ′ ( Θ ∣ D ^ o b s , Z ^ o b s , I o b s ) ≃ 1 M ∑ m = 1 M P ( Θ ∣ D ^ m , Z ^ m , I m ) , (37) P'(\boldsymbol{\Theta} \mid\hat{\mathbf{D}}_{\mathrm{obs}}, \hat{\mathbf{Z}}_{\mathrm{obs}}, \mathbf{I}_{\mathrm{obs}}) \simeq\frac{1}{M} \sum_{m=1}^{M} P(\boldsymbol{\Theta} \mid\hat{\mathbf{D}}^{m}, \hat{\mathbf{Z}}^{m}, \mathbf{I}^{m}), \tag*{(37)} P ′ ( Θ ∣ D ^ obs , Z ^ obs , I obs ) ≃ M 1 m = 1 ∑ M P ( Θ ∣ D ^ m , Z ^ m , I m ) , (37)
where Θ = ( Θ S N I a , ζ I a I a , C ) \boldsymbol{\Theta} = (\boldsymbol{\Theta}_{\mathrm{SN}}^{\mathrm{Ia}}, \zeta_{\mathrm{Ia}}^{\mathrm{Ia}}, \mathcal{C}) Θ = ( Θ SN Ia , ζ Ia Ia , C ) . A non-Ia contaminant likelihood (Kunz et al. 2007) is not included, so we make no inferences about the non-Ia contaminant population parameters Θ S N n o n − I a \boldsymbol{\Theta}_{\mathrm{SN}}^{\mathrm{non-Ia}} Θ SN non − Ia .
For model comparison, we proceed in a similar way. For each resample, we evaluate the Bayes factor on the retained sample and combine the results as
B F 1 , 0 ′ = [ B F 0 , 1 ] − 1 ≃ [ 1 M ∑ m = 1 M P ( D ^ m , Z ^ m ∣ I m , M 0 ) P ( D ^ m , Z ^ m ∣ I m , M 1 ) ] − 1 , (38) \mathrm{BF}'_{1,0} = [\mathrm{BF}_{0,1}]^{-1} \simeq\left[\frac{1}{M}\sum_{m=1}^{M}\frac{P(\hat{\mathbf{D}}^{m},\hat{\mathbf{Z}}^{m}\mid\mathbf{I}^{m},\mathcal{M}_{0})}{P(\hat{\mathbf{D}}^{m},\hat{\mathbf{Z}}^{m}\mid\mathbf{I}^{m},\mathcal{M}_{1})}\right]^{-1}, \tag*{(38)} BF 1 , 0 ′ = [ BF 0 , 1 ] − 1 ≃ [ M 1 m = 1 ∑ M P ( D ^ m , Z ^ m ∣ I m , M 1 ) P ( D ^ m , Z ^ m ∣ I m , M 0 ) ] − 1 , (38)
where the numerator and denominator are evaluated on the same resampled dataset ( D ^ m , Z ^ m ) (\hat{\mathbf{D}}^{m}, \hat{\mathbf{Z}}^{m}) ( D ^ m , Z ^ m ) , so each term is a well-defined Bayes factor for that resampled data and no contaminant likelihood is required. For nested models, assuming a common prior across class allocations, the Savage-Dickey density ratio evaluated on the modular posterior is
B F 1 , 0 ′ ≃ ∑ m = 1 M P ( θ = θ 0 ∣ I m , M 1 ) ∑ m = 1 M P ( θ = θ 0 ∣ D ^ m , Z ^ m , I m , M 1 ) , (39) \mathrm{BF}'_{1,0} \simeq\frac{\sum_{m=1}^{M}P(\theta= \theta_{0}\mid\mathbf{I}^{m},\mathcal{M}_{1})}{\sum_{m=1}^{M}P(\theta= \theta_{0}\mid\hat{\mathbf{D}}^{m},\hat{\mathbf{Z}}^{m},\mathbf{I}^{m},\mathcal{M}_{1})}, \tag*{(39)} BF 1 , 0 ′ ≃ ∑ m = 1 M P ( θ = θ 0 ∣ D ^ m , Z ^ m , I m , M 1 ) ∑ m = 1 M P ( θ = θ 0 ∣ I m , M 1 ) , (39)
reusing the per-resample marginal posterior densities used to construct the modular posterior in Eq. (37) .
Normalising Flow Training
In this subsection, we describe the general simulations and procedures needed to train our normalising flows q ϕ 1 q_{\phi_{1}} q ϕ 1 and q ϕ 2 q_{\phi_{2}} q ϕ 2 .
Training Simulations
In our training, we assume the general forward model described in § 2.1 , starting with population-level parameters, leading to intermediate latent parameters and resulting in observed summaries and redshifts for the selected SNe Θ → ( μ t , x t ) → ( d ^ t , z ^ t ) \boldsymbol{\Theta} \to(\mu_t,x_t) \to(\hat{\mathbf{d}}_t,\hat{z}_t) Θ → ( μ t , x t ) → ( d ^ t , z ^ t ) . Both normalising flows can be trained using the same training simulations under a single fiducial combination of cosmology parameters C 1 \mathcal{C}_1 C 1 , fiducial SN Ia rate ξ r a t e , f i d I a \xi_{\mathrm{rate,fid}}^{\mathrm{Ia}} ξ rate , fid Ia and fiducial intrinsic absolute magnitude M 0 , f i d i n t M_{0,\mathrm{fid}}^{\mathrm{int}} M 0 , fid int . We also assume no intrinsic mass-step γ = 0 \gamma= 0 γ = 0 in our training. Since we follow the modular Bayesian prescription for handling contamination (Autenrieth et al. 2026), as described in § 2.9 , we only need to simulate a pure SN Ia sample to train our SN Ia model, avoiding the need to train on contaminants.
Our simulations vary each of the other SN population parameters Θ S N t = ( α t , β t i n t , R t B , τ t , σ t i n t , θ t x , θ t c , i n t ) \boldsymbol{\Theta}_{\mathrm{SN}}^{t} = (\alpha_t,\beta_t^{\mathrm{int}},R_t^{B},\tau_t,\sigma_t^{\mathrm{int}},\theta_t^{x},\theta_t^{c,\mathrm{int}}) Θ SN t = ( α t , β t int , R t B , τ t , σ t int , θ t x , θ t c , int ) for each simulated object t t t such that Θ S N t ∼ P t r a i n ( Θ S N ) \boldsymbol{\Theta}_{\mathrm{SN}}^{t} \sim P_{\mathrm{train}}(\boldsymbol{\Theta}_{\mathrm{SN}}) Θ SN t ∼ P train ( Θ SN ) . The training distribution need not be equal to our inferential priors over the population parameters P t r a i n ( Θ S N ) ≠ P ( Θ S N ) P_{\mathrm{train}}(\boldsymbol{\Theta}_{\mathrm{SN}}) \ne P(\boldsymbol{\Theta}_{\mathrm{SN}}) P train ( Θ SN ) = P ( Θ SN ) , though they must be supported in the same range. If it is not possible to vary the population parameters per-event in a particular simulator, the alternative options are either assuming the population parameters to be constant or conditioning flow q 1 ϕ 1 q_{1}^{\phi_{1}} q 1 ϕ 1 on latent d t \boldsymbol{d}_{t} d t , although this will incur three latent parameters per SN at inference time.
Our second requirement for the training simulator is that we can apply a per-event smearing to the latent SN distance such that
μ t = μ ( z t ; C 1 ) + ϵ t μ (40) \mu_{t} = \mu(z_{t}; \boldsymbol{C}_{1}) + \epsilon_{t}^{\mu} \tag*{(40)} μ t = μ ( z t ; C 1 ) + ϵ t μ (40)
where ϵ t μ ∼ N ( 0 , σ μ 2 ) \epsilon_{t}^{\mu} \sim N(0, \sigma_{\mu}^{2}) ϵ t μ ∼ N ( 0 , σ μ 2 ) . This smearing is applied to the latent variable during simulation and before selection. The purpose of the smearing is to allow support over pairs of ( z s , μ t ) (z_{s}, \mu_{t}) ( z s , μ t ) beyond C 1 \boldsymbol{C}_{1} C 1 , including those from a different cosmological model e.g., w w w CDM and w 0 w a w_{0}w_{a} w 0 w a CDM. We find a smearing of σ μ ≈ 0.25 \sigma_{\mu} \approx0.25 σ μ ≈ 0.25 to provide sufficient support over typical cosmological parameter priors.
The relevant parameters that should be logged to train the flows include the fiducial parameters ( C 1 , ξ r a t e , f i d I a , M 0 , f i d i n t ) (\boldsymbol{C}_{1}, \xi_{\mathrm{rate,fid}}^{\mathrm{Ia}}, M_{0,\mathrm{fid}}^{\mathrm{int}}) ( C 1 , ξ rate , fid Ia , M 0 , fid int ) , per object varying population parameters Θ S N \boldsymbol{\Theta}_{\mathrm{SN}} Θ SN , post-smearing latent distance μ t \mu_{t} μ t , latent redshift z t z_{t} z t , observed summaries d ^ t \hat{\boldsymbol{d}}_{t} d ^ t along with covariances Σ t \boldsymbol{\Sigma}_{t} Σ t and observed redshift z ^ t \hat{z}_{t} z ^ t with measurement uncertainty σ z , t \sigma_{z,t} σ z , t . If the photometric redshift estimate is provided using probability quantiles, we recommend randomly sampling from this to generate z ^ t \hat{z}_{t} z ^ t and σ z , t \sigma_{z,t} σ z , t . We find simulating N t r a i n ≈ 25 N_{\mathrm{train}} \approx25 N train ≈ 25 million selected SNe to be sufficient to train both flows.
Training Flow q 1 ϕ 1 q_{1}^{\phi_{1}} q 1 ϕ 1
A normalising flow ((Tabak & Vanden-Eijnden 2010; Tabak & Turner 2013)) is a flexible density estimator, helpful for approximating intractable distributions. We opt for using a normalising flow over a mixture density network ((Bishop 1994)) because it provides the non-Gaussian flexibility needed to model the non-analytical selection effects inherent in realistic surveys. Our first normalising flow is similar to the normalising flow used in the FlowSN methodology ((Boyd et al. 2026)), but extends it to model redshifts as data. The target likelihood to be learnt is the four-dimensional auxiliary density defined in Eq. (25) . We can describe g 1 g_{1} g 1 as the combined SN summary statistic and redshift distribution given the true underlying parameters. The normalising flow q 1 ϕ 1 q_{1}^{\phi_{1}} q 1 ϕ 1 , used to approximate g 1 g_{1} g 1 , is defined as
q 1 ϕ 1 ( d ^ , z ^ ∣ ψ 1 = ( m 0 , z , Σ , σ z , Θ S N ) ) = N ( u 0 ∣ 0 , I ) ∏ l = 1 L ∣ ∂ f ϕ l ∂ u l − 1 ∣ − 1 , (41) q_{1}^{\phi_{1}}(\hat{\boldsymbol{d}}, \hat{z} \mid\boldsymbol{\psi}_{1} = (m_{0}, z, \boldsymbol{\Sigma}, \sigma_{z}, \boldsymbol{\Theta}_{\mathrm{SN}})) = N(\boldsymbol{u}_{0} \mid0, \boldsymbol{I}) \prod_{l=1}^{L} \left\lvert\frac{\partial f^{\phi_{l}}}{\partial\boldsymbol{u}_{l-1}} \right\rvert^{-1}, \tag*{(41)} q 1 ϕ 1 ( d ^ , z ^ ∣ ψ 1 = ( m 0 , z , Σ , σ z , Θ SN )) = N ( u 0 ∣ 0 , I ) l = 1 ∏ L ∂ u l − 1 ∂ f ϕ l − 1 , (41)
where u 0 ∼ N ( 0 , I ) \boldsymbol{u}_{0} \sim N(0, \boldsymbol{I}) u 0 ∼ N ( 0 , I ) , u l = f ϕ l ( u l − 1 ∣ ψ 1 = ( m 0 , z , Σ , σ z , Θ S N ) ) \boldsymbol{u}_{l} = f^{\phi_{l}}(\boldsymbol{u}_{l-1} \mid\boldsymbol{\psi}_{1} = (m_{0}, z, \boldsymbol{\Sigma}, \sigma_{z}, \boldsymbol{\Theta}_{\mathrm{SN}})) u l = f ϕ l ( u l − 1 ∣ ψ 1 = ( m 0 , z , Σ , σ z , Θ SN )) and ( d ^ , z ^ ) = f L ϕ L ( u L − 1 ∣ ψ 1 ) (\hat{\boldsymbol{d}}, \hat{z}) = f_{L}^{\phi_{L}}(\boldsymbol{u}_{L-1} \mid\boldsymbol{\psi}_{1}) ( d ^ , z ^ ) = f L ϕ L ( u L − 1 ∣ ψ 1 ) . We stack L L L transforms f f f with learnable parameters ϕ 1 \boldsymbol{\phi}_{1} ϕ 1 . Evaluating normalising flows using the chain rule is straightforward as their architectures are explicitly designed with low triangular Jacobian matrices, allowing the determinant to be computed simply as the product of the diagonal elements. In this study, we use the Masked Autoregressive Flow (MAF) architecture ((Papamakarios et al. 2017)), which is constructed by stacking Masked Auto-encoder for Distribution Estimation (MADE) transform blocks ((Germain et al. 2015)).
The objective is to minimise the negative log-density of the normalising flow with respect to ϕ 1 \boldsymbol{\phi}_{1} ϕ 1 at each step over the joint training distribution of the observed data ( d ^ , z ^ ) (\hat{\boldsymbol{d}}, \hat{z}) ( d ^ , z ^ ) and conditional context ψ 1 \boldsymbol{\psi}_{1} ψ 1 , such that
min ϕ 1 E ( d ^ t , z ^ t , ψ t ) ∼ P t r a i n ( d ^ , z ^ , ψ ) [ − log q 1 ϕ 1 ( d ^ t , z ^ t ∣ ψ t 1 ) ] , (42) \min_{\boldsymbol{\phi}_{1}} \mathbb{E}_{(\hat{\boldsymbol{d}}_{t},\hat{z}_{t},\boldsymbol{\psi}_{t})\sim P_{\mathrm{train}}(\hat{\boldsymbol{d}},\hat{z},\boldsymbol{\psi})} \left[ -\log q_{1}^{\phi_{1}}(\hat{\boldsymbol{d}}_{t},\hat{z}_{t} \mid\boldsymbol{\psi}_{t}^{1}) \right], \tag*{(42)} ϕ 1 min E ( d ^ t , z ^ t , ψ t ) ∼ P train ( d ^ , z ^ , ψ ) [ − log q 1 ϕ 1 ( d ^ t , z ^ t ∣ ψ t 1 ) ] , (42)
where we sample the training data from the joint distribution P t r a i n ( d ^ , z ^ , ψ 1 ) P_{\mathrm{train}}(\hat{\boldsymbol{d}}, \hat{z}, \boldsymbol{\psi}_{1}) P train ( d ^ , z ^ , ψ 1 ) . The objective is optimised at each training iteration using stochastic gradient descent in normalising flow parameter-space ϕ \boldsymbol{\phi} ϕ , where the expectation is approximated with empirical averages over mini-batches { ( d ^ t , z ^ t , ψ t 1 ) } t = 1 B \{(\hat{\boldsymbol{d}}_{t}, \hat{z}_{t}, \boldsymbol{\psi}_{t}^{1})\}_{t=1}^{B} {( d ^ t , z ^ t , ψ t 1 ) } t = 1 B of size B B B
min ϕ 1 1 B ∑ t = 1 B − log q 1 ϕ 1 ( d ^ t , z ^ t ∣ ψ t 1 ) . (43) \min_{\boldsymbol{\phi}_{1}} \frac{1}{B} \sum_{t=1}^{B} -\log q_{1}^{\phi_{1}}(\hat{\boldsymbol{d}}_{t}, \hat{z}_{t} \mid\boldsymbol{\psi}_{t}^{1}). \tag*{(43)} ϕ 1 min B 1 t = 1 ∑ B − log q 1 ϕ 1 ( d ^ t , z ^ t ∣ ψ t 1 ) . (43)
This optimisation is equivalent to minimising a Monte Carlo approximation of the forward Kullback–Leibler (KL) divergence between g 1 g_{1} g 1 and q 1 ϕ 1 q_{1}^{\phi_{1}} q 1 ϕ 1 ((Papamakarios et al. 2021)).
We note that by doing so, we explicitly condition the normalising flow on latent z t z_{t} z t and μ t \mu_{t} μ t (through m 0 t = M 0 i n t + μ t m_{0}^{t} = M_{0}^{\mathrm{int}} + \mu_{t} m 0 t = M 0 int + μ t ), before peculiar velocities are introduced in the simulations. This means the normalising-flow implicitly learns the influence of peculiar velocities, as well as the influence of selection effects and measurement uncertainties, on the observed data.
Training Flow q 2 ϕ 2 q_{2}^{\phi_{2}} q 2 ϕ 2
In our new FlowSN2 methodology, we introduce a second normalising flow. The purpose of this flow is to learn the two-dimensional latent ( z , μ ) (z,\mu) ( z , μ ) distribution under the influence of selection. This problem can be re-parameterised in the μ \mu μ dimension as the difference between simulated training distance (after smearing) μ t \mu_{t} μ t and the distance under the assumed fiducial cosmology such that Δ μ t = μ t − μ ( z t ; C 1 ) \Delta\mu_{t} = \mu_{t} - \mu(z_{t}; \boldsymbol{C}_{1}) Δ μ t = μ t − μ ( z t ; C 1 ) . We define the auxiliary density g 2 ( Δ μ , z ∣ Θ S N ) g_{2}(\Delta\mu,z \mid\boldsymbol{\Theta}_{\mathrm{SN}}) g 2 ( Δ μ , z ∣ Θ SN ) in Eq. (28) . To train the normalising flow q 2 ϕ 2 q_{2}^{\phi_{2}} q 2 ϕ 2 , with trainable parameters ϕ 2 \boldsymbol{\phi}_{2} ϕ 2 , to approximate g 2 g_{2} g 2 , we define the objective
min ϕ 2 E ( Δ μ t , z t , Θ S N t ) ∼ P t r a i n ( Δ μ , z , Θ S N ) [ − log q 2 ϕ 2 ( Δ μ t , z t ∣ Θ S N t ) ] . (44) \min_{\boldsymbol{\phi}_{2}} \mathbb{E}_{(\Delta\mu_{t},z_{t},\boldsymbol{\Theta}_{\mathrm{SN}}^{t})\sim P_{\mathrm{train}}(\Delta\mu,z,\boldsymbol{\Theta}_{\mathrm{SN}})} \left[ -\log q_{2}^{\phi_{2}}(\Delta\mu_{t},z_{t} \mid\boldsymbol{\Theta}_{\mathrm{SN}}^{t}) \right]. \tag*{(44)} ϕ 2 min E ( Δ μ t , z t , Θ SN t ) ∼ P train ( Δ μ , z , Θ SN ) [ − log q 2 ϕ 2 ( Δ μ t , z t ∣ Θ SN t ) ] . (44)
We use the same MAF architecture and mini-batch optimisation procedure as used for q 1 ϕ 1 q_{1}^{\phi_{1}} q 1 ϕ 1 , described in Section 2.6.2.
Implementation
In this subsection, we describe the technical implementation of the FlowSN2 framework. To improve training stability when training q 1 ϕ 1 q_{1}^{\phi_{1}} q 1 ϕ 1 , we firstly recenter observable dimensions so that the flow effectively learns residual distributions. Specifically, we subtract true redshifts from observed redshifts ( z ^ t → z ^ t − z t ) (\hat{z}_{t} \rightarrow\hat{z}_{t} - z_{t}) ( z ^ t → z ^ t − z t ) and subtract population means d 0 t = ( m 0 t , c 0 t , x 1 t ) \boldsymbol{d}_{0}^{t} = (m_{0}^{t}, c_{0}^{t}, x_{1}^{t}) d 0 t = ( m 0 t , c 0 t , x 1 t ) from light curve summaries ( d ^ t → d ^ t − d 0 t ) (\hat{\boldsymbol{d}}_{t} \rightarrow\hat{\boldsymbol{d}}_{t} - \boldsymbol{d}_{0}^{t}) ( d ^ t → d ^ t − d 0 t ) . Following this centring step, all dimensions (including contextual variables) are standardised to zero mean and unit variance via x t → ( x t − x ˉ ) / s x x_{t} \rightarrow(x_{t} - \bar{x})/s_{x} x t → ( x t − x ˉ ) / s x , using the sample mean x ˉ \bar{x} x ˉ and standard deviation s x s_{x} s x of the training set.
For q 1 ϕ 1 q_{1}^{\phi_{1}} q 1 ϕ 1 , the architecture consists of L = 4 L = 4 L = 4 stacked Masked Auto-encoder for Distribution Estimation (MADE) blocks, permuting the conditional feature ordering between successive blocks. Each block comprises two hidden layers with 64 units each, totalling 24,872 learnable parameters. For q 2 ϕ 2 q_{2}^{\phi_{2}} q 2 ϕ 2 , we adopt a lighter architecture comprising L = 2 L = 2 L = 2 MADE blocks with two hidden layers of 16 units each, amounting to 1,236 learnable parameters. It takes ∼ 200 \sim200 ∼ 200 kB per survey to store our flow weights. To ensure network predictions satisfy the requirement of at least second-order continuous differentiability for downstream sampling, we employ GELU activation functions throughout.
Training was performed on 2745 mini-batches of size B = 8,192 B = 8{,}192 B = 8 , 192 SNe, reserving 10% of the training data as a validation set. We save the model checkpoint yielding the lowest validation loss over 20 epochs for ϕ q 1 1 \phi^{1}_{q_1} ϕ q 1 1 and 10 epochs for ϕ q 2 ϕ 2 \phi^{\phi_2}_{q_2} ϕ q 2 ϕ 2 . We implement the normalising flows using FlowJAX Ward (2024), built upon JAX Bradbury et al. (2018) to facilitate seamless integration with the numpyro Phan et al. (2019) hierarchical Bayesian modelling framework. On a single NVIDIA A100 GPU, training both normalising flows requires approximately 10 minutes in total.
To evaluate the numerator of Eq. (31) , we perform numerical integration via the trapezium rule across a grid centred on the measured redshift, with a total grid width dictated by its observational uncertainty. The denominator is integrated across the full redshift range. Owing to its independence from individual SN observations, the denominator requires evaluation only once (or twice if population parameters are split by host-galaxy mass).
To sample the posterior, we use Hamiltonian Monte Carlo (HMC; Duane et al. (1987)) via the No-U-Turn Sampler (NUTS; Betancourt et al. (2014); Betancourt (2017)) implementation in numpyro (Bingham et al. (2019); Phan et al. (2019)). Unlike traditional random-walk Markov Chain Monte Carlo algorithms, HMC uses gradient information of the target posterior density to simulate physical particle dynamics, allowing it to explore high-dimensional, highly correlated parameter spaces with high efficiency and faster convergence.
To supply HMC with the required gradients across both our neural normalising flows and cosmological functions, we rely on automatic differentiation and just-in-time (JIT) compilation provided by JAX Bradbury et al. (2018). This allows exact gradients to be computed via backpropagation without resorting to computationally expensive finite-difference approximations. Cosmological distance calculations leverage wcosmo 4 for w w w CDM models and a custom JAX implementation for w 0 w a w_0w_a w 0 w a CDM models.
For a sample of ≈ 2000 \approx2000 ≈ 2000 SNe, sampling a single posterior chain takes under 10 minutes on an NVIDIA A100 GPU. Incorporating Bayesian resampling to account for contamination (M = 5 M = 5 M = 5 resamples; § 2.9 ) yields a total inference runtime under 50 minutes. For each resample, we run four parallel chains with 300 warmup steps and 300 production samples, yielding an average effective sample size (ESS) of 619 across global parameters. Convergence is confirmed across all parameters via Gelman-Rubin diagnostics (R ^ < 1.01 \hat{R} < 1.01 R ^ < 1.01 ; Gelman & Rubin (1992); Vehtari et al. (2021)) and zero divergent transitions. For Savage-Dickey density ratio calculations (Eq. (35) ), marginal posterior densities at θ 0 \theta_0 θ 0 are evaluated by fitting Gaussian kernel estimates directly to the posterior samples.
The complete codebase for FlowSN2 is publicly available at: https://github.com/bayesen/flowsn2.
Experiments
In this section, we describe the experiments and results used to validate the FlowSN2 framework. The experiments use a simplified forward model similar to the one used in Boyd et al. (2024) and later Boyd et al. (2026) that has an analytical likelihood solution. While elements of the simulations are intentionally simplistic, so we can compare with a tractable solution, it provides further confidence when moving to more complex regimes where there are no analytical solutions. This was demonstrated in Boyd et al. (2026), where we showed the methodology originally developed on simplified models could naturally be extended to realistic state-of-the-art SNANA survey simulations (Kessler et al. (2009) of LSST (Ivezić et al. (2019)).
Dusty Photometric Redshift Analysis on Pure-Ia Samples
Here we describe the experiments used to validate our new framework can correctly account for photometric redshifts, as well as dust modelling, in a SN Ia cosmology analysis that is under the influence of selection effects. We also take the opportunity to combine mock low redshift spectroscopic and high redshift photometric surveys for the first time using our framework. We introduce classification and contamination into the experiments in § 3.3.1 .
Experimental Setup
In these experiments we follow the general forward model described in § 2.1 whilst making additional assumptions to allow for a tractable analytical likelihood solution.
We draw peculiar velocities from a Gaussian distribution such that
v p e c s ∼ N ( 0 , σ p e c 2 ) , (45) v_{\rm pec}^{s} \sim N(0,\sigma_{\rm pec}^{2}), \tag*{(45)} v pec s ∼ N ( 0 , σ pec 2 ) , (45)
where σ p e c = 300 k m s − 1 \sigma_{\rm pec} = 300\ {\rm km\ s}^{-1} σ pec = 300 km s − 1 . For simplicity, we also set the observer’s velocity relative to the CMB rest-frame projected along the line of sight to the SNe to zero v ⊙ s = 0 v_{\odot}^{s} = 0 v ⊙ s = 0 .
Observed photometric redshifts are modelled to have Gaussian uncertainties such that
z ^ s h e l ∼ N ( z s h e l , σ z , s 2 ) , (46) \hat{z}_{s}^{\rm hel} \sim N(z_{s}^{\rm hel},\sigma_{z,s}^{2}), \tag*{(46)} z ^ s hel ∼ N ( z s hel , σ z , s 2 ) , (46)
where σ z , s = 0.03 ( 1 + z s h e l ) \sigma_{z,s} = 0.03(1 + z_{s}^{\rm hel}) σ z , s = 0.03 ( 1 + z s hel ) . The methodology itself is flexible to allow for non-Gaussian and multimodal photometric redshift estimates, however, we leave demonstration of this for future work. We assume our spectroscopic redshift sample has negligible uncertainty of σ z , s = ( 1 × 10 − 4 ) ( 1 + z s h e l ) \sigma_{z,s} = (1 \times10^{-4})(1 + z_{s}^{\rm hel}) σ z , s = ( 1 × 1 0 − 4 ) ( 1 + z s hel ) .
We sample light curve shapes x s x_s x s from a Gaussian population distribution
x s ∼ N ( x 0 , σ x 2 ) , (47) x_s \sim N(x_0,\sigma_x^2), \tag*{(47)} x s ∼ N ( x 0 , σ x 2 ) , (47)
where x 0 x_0 x 0 represents the population mean and population σ x 2 \sigma_x^2 σ x 2 variance as in Mandel et al. (2017).
The intrinsic SN colour is sampled from a Gaussian population distribution
c s i n t ∼ N ( c 0 i n t + α c x s , σ c , i n t 2 ) , (48) c_s^{\rm int} \sim N(c_0^{\rm int} + \alpha_c x_s,\sigma_{c,\rm int}^{2}), \tag*{(48)} c s int ∼ N ( c 0 int + α c x s , σ c , int 2 ) , (48)
where α c \alpha_c α c allows for correlations with light curve shape, c i n t c^{\rm int} c int is the intrinsic colour population mean (when α c = 0 \alpha_c = 0 α c = 0 ) and σ c , i n t 2 \sigma_{c,\rm int}^{2} σ c , int 2 is the intrinsic colour population variance.
The extrinsic dust colour excess E s E_s E s is drawn from the exponential distribution
E s ∼ P ( E ∣ τ ) = { 1 τ exp ( − E s τ ) if E s ≥ 0 , 0 if E s < 0 (49) E_s \sim P(E \mid\tau) =
\begin{cases}
\frac{1}{\tau}\exp\left(-\frac{E_s}{\tau}\right) & \text{if } E_s \ge0,\\
0 & \text{if } E_s < 0
\end{cases} \tag*{(49)} E s ∼ P ( E ∣ τ ) = { τ 1 exp ( − τ E s ) 0 if E s ≥ 0 , if E s < 0 (49)
where τ \tau τ is the average colour excess.
Host galaxy masses are drawn randomly from
log 10 ( M s / M ⊙ ) ∼ U ( 8 , 12 ) . (50) \log_{10}(M_s/M_\odot) \sim U(8,12). \tag*{(50)} log 10 ( M s / M ⊙ ) ∼ U ( 8 , 12 ) . (50)
In this work, we assume no uncertainty on the observed masses and set the step threshold as M s t e p = 10 10 M ⊙ \mathcal{M}_{\rm step} = 10^{10}\,M_\odot M step = 1 0 10 M ⊙ . Future work using the methodology may model uncertainties on galaxy masses by feeding these into the normalising flow.
The latent apparent magnitude is calculated using the Simple-BayeSN (Mandel et al. (2017)) linear formula as defined in Eq. (13) . Instead of simulating the light curve data, we simulate summary statistics d ^ s \hat{\boldsymbol{d}}_s d ^ s directly from latent variables d s \boldsymbol{d}_s d s using a multivariate Gaussian distribution such that
d ^ s ∼ P ( d ^ ∣ d s , z ^ s h e l ) = N ( d ^ ∣ d s , Σ s ) . (51) \hat{\boldsymbol{d}}_s \sim P(\hat{\boldsymbol{d}} \mid\boldsymbol{d}_s, \hat{z}^{\mathrm{hel}}_s) = N(\hat{\boldsymbol{d}} \mid\boldsymbol{d}_s, \boldsymbol{\Sigma}_s). \tag*{(51)} d ^ s ∼ P ( d ^ ∣ d s , z ^ s hel ) = N ( d ^ ∣ d s , Σ s ) . (51)
We draw the summary statistic fit covariance matrices Σ s \boldsymbol{\Sigma}_s Σ s using the relations in Appendix § 7 , approximately based on those in the Pantheon+ dataset (Scolnic et al. 2022).
We define two selection probabilities in terms of the observed summary parameters. The first selection probability that is a function of the observed SN light curve summary parameters is given by
P ( I s = 1 ∣ d ^ s ) = Φ ( m c u t − ( m ^ s + a c u t , m x ^ s + b c u t , m c ^ s ) σ c u t , m ) , (52) P(I_s = 1 \mid\hat{\boldsymbol{d}}_s) = \Phi\left(\frac{m_{\mathrm{cut}} - (\hat{m}_s + a_{\mathrm{cut},m}\hat{x}_s + b_{\mathrm{cut},m}\hat{c}_s)}{\sigma_{\mathrm{cut},m}}\right), \tag*{(52)} P ( I s = 1 ∣ d ^ s ) = Φ ( σ cut , m m cut − ( m ^ s + a cut , m x ^ s + b cut , m c ^ s ) ) , (52)
as used in the (Rubin et al. 2015) model and the second selection probability allows the observed redshifts to influence selection
P ( I s = 1 ∣ z ^ s ) = Φ ( z c u t − z ^ s σ c u t , z ) , (53) P(I_s = 1 \mid\hat{z}_s) = \Phi\left(\frac{z_{\mathrm{cut}} - \hat{z}_s}{\sigma_{\mathrm{cut},z}}\right), \tag*{(53)} P ( I s = 1 ∣ z ^ s ) = Φ ( σ cut , z z cut − z ^ s ) , (53)
where Φ ( ⋅ ) \Phi(\cdot) Φ ( ⋅ ) is a Gaussian cumulative distribution function. In our simulations, the two surveys have different selection probability parameters.
For our high redshift photometric survey we simulate 5,000 SNe Ia between 0 < z s < 1.2 0 < z_s < 1.2 0 < z s < 1.2 . The high redshift survey, chosen to have comparable settings to the Dark Energy Survey [28 ] , has m c u t = 24.5 m_{\mathrm{cut}} = 24.5 m cut = 24.5 mag, σ c u t , m = 0.5 \sigma_{\mathrm{cut},m} = 0.5 σ cut , m = 0.5 mag, a c u t , m = − 0.1 a_{\mathrm{cut},m} = -0.1 a cut , m = − 0.1 , b c u t , m = 1 b_{\mathrm{cut},m} = 1 b cut , m = 1 , z c u t = 0.9 z_{\mathrm{cut}} = 0.9 z cut = 0.9 and σ c u t , z = 0.1 \sigma_{\mathrm{cut},z} = 0.1 σ cut , z = 0.1 , yielding N o b s ≈ 2 , 000 N^{\mathrm{obs}} \approx2,000 N obs ≈ 2 , 000 SNe Ia post-selection. Future SN cosmological analyses will still rely on low redshift spectroscopic samples from surveys, such as TiDES (Frohmaier et al. 2025), to anchor cosmological constraints.
We simulate an additional 5,000 low redshift spectroscopic SNe Ia with negligible redshift uncertainties between 0 < z s < 0.3 0 < z_s < 0.3 0 < z s < 0.3 . The low redshift survey has m c u t = 20.0 m_{\mathrm{cut}} = 20.0 m cut = 20.0 mag, σ c u t , m = 0.25 \sigma_{\mathrm{cut},m} = 0.25 σ cut , m = 0.25 mag, a c u t , m = − 0.1 a_{\mathrm{cut},m} = -0.1 a cut , m = − 0.1 , b c u t , m = 1 b_{\mathrm{cut},m} = 1 b cut , m = 1 , z c u t = 0.1 z_{\mathrm{cut}} = 0.1 z cut = 0.1 and σ c u t , z = 0.25 \sigma_{\mathrm{cut},z} = 0.25 σ cut , z = 0.25 , yielding N o b s ≈ 300 N^{\mathrm{obs}} \approx300 N obs ≈ 300 SNe Ia post-selection. The distribution of our selected SNe from the two simulated surveys is visualised in Figure 1 .
The true SN Ia population parameters Θ S N \boldsymbol{\Theta}_{\mathrm{SN}} Θ SN used in our simulations are in Table E1 and Table E2 . The priors on our global parameters used in inference are in Table C1. We simulate from five different cosmologies C 1 \boldsymbol{C}_1 C 1 to C 5 \boldsymbol{C}_5 C 5 , whilst also varying ξ r a t e \xi_{\mathrm{rate}} ξ rate . For C 1 \boldsymbol{C}_1 C 1 to C 3 \boldsymbol{C}_3 C 3 we perform inference with and without a CMB prior. For C 4 \boldsymbol{C}_4 C 4 and C 5 \boldsymbol{C}_5 C 5 we perform our w 0 − w a w_0-w_a w 0 − w a inference with baryon acoustic oscillation (BAO) and CMB priors. Both the BAO and CMB priors used in our experiments are defined in Appendix D. The analytical likelihood solution for this forward model used for comparison is derived in Appendix § 6 .
Table E1. Average of posterior median estimates over 25 repeats and the standard error on this average for the photometric SN Ia cosmology experiments without contamination. We include FlowSN2 inferences, as well as result that use the analytical likelihood solution for comparison. We also combine SNe with a CMB prior for additional constraining as detailed in Appendix D. Note uncertainties are the standard error on the average so are a factor of five smaller than those in individual experiments. The σ \sigma σ values are calculated using unrounded averages and standard errors.
Table E1.
Table E2. Average of posterior median estimates over 25 repeats and the standard error on this average for the photometric SN Ia cosmology experiments without contamination. Here we inference results on w 0 w a w_0w_a w 0 w a CDM model parameters. We include FlowSN2 inferences, as well as result that use the analytical likelihood solution for comparison. In order to constrain the evolving dark energy model we include CMB and BAO priors as detailed in Appendix D. Note uncertainties are the standard error on the average so are a factor of five smaller than those in individual experiments. The σ \sigma σ values are calculated using unrounded averages and standard errors.
Training
To train our normalising flows, we use the same procedures described in § 2.10 and the implementations described in § 2.12 . We train four normalising flows in total, including a q 1 ϕ 1 q^{\phi_1}_1 q 1 ϕ 1 and q 2 ϕ 2 q^{\phi_2}_2 q 2 ϕ 2 for each of the low redshift and high redshift surveys. This involves simulating N o b s ≈ 25 N^{\mathrm{obs}} \approx25 N obs ≈ 25 million selected low redshift spectroscopic SNe Ia and N o b s ≈ 25 N^{\mathrm{obs}} \approx25 N obs ≈ 25 million selected high redshift photometric SNe Ia using the forward model defined in § 3.1.1 . We do not train on contaminants. All the SNe were simulated with the same fiducial cosmology parameters C 1 = ( w 0 = − 1.0 , w a = 0 , Ω m 0 = 0.315 , Ω Λ 0 = 0.685 , h = 0.7 ) \boldsymbol{C}_1 = (w_0 = -1.0, w_a = 0, \Omega_{m0} = 0.315, \Omega_{\Lambda0} = 0.685, h = 0.7) C 1 = ( w 0 = − 1.0 , w a = 0 , Ω m 0 = 0.315 , Ω Λ0 = 0.685 , h = 0.7 ) , a sample fiducial absolute magnitude zeropoint M 0 , f i d r a t e = − 19.38 M^{\mathrm{rate}}_{0,\mathrm{fid}} = -19.38 M 0 , fid rate = − 19.38 . We use a Gaussian distance smearing standard deviation of σ μ = 0.25 \sigma_\mu= 0.25 σ μ = 0.25 . The population parameter training distributions Θ S N t ∼ p t r a i n ( Θ S N ) \boldsymbol{\Theta}^{\mathrm{t}}_{\mathrm{SN}} \sim p_{\mathrm{train}}(\boldsymbol{\Theta}_{\mathrm{SN}}) Θ SN t ∼ p train ( Θ SN ) are shown in Table C1.
SN Ia Only Results
Prior to inference, we assess the quality of our learnt q 1 ϕ 1 q^{\phi_1}_1 q 1 ϕ 1 likelihood approximation by comparing its samples against held-out data distributions as demonstrated in Figure 4 . We find that the four-dimensional normalising flow closely approximates the selected SN distribution, particularly at high redshifts where the selected and underlying population distributions diverge most strongly. Similarly, inspecting the q 2 ϕ 2 q^{\phi_2}_2 q 2 ϕ 2 distributions (illustrated in Figure 3 ) reveals a decrease in selected SNe at high redshift on the latent bubble diagram. Evaluating samples from the normalising flows against held-out data thus serves as a reliable validation step before proceeding to inference. The same four normalising flows (two for each survey) are utilised across both the pure-Ia and contamination experiments, as well as in further investigations into scaling and model selection.
Figure 4. Samples from our trained four-dimensional normalising flow q 1 ϕ 1 q^{\phi_1}_1 q 1 ϕ 1 corresponding to the photometric redshift survey. We condition on the highest redshift SNe to highlight the maximum impact of selection effects. The distribution of unseen validation data demonstrates that the normalising flow has captured the influence of selection, relative to the full population shown in grey.
We perform inference on the combined N o b s ≈ 2 , 300 N^{\mathrm{obs}} \approx2,300 N obs ≈ 2 , 300 pure-Ia sample drawn from the two surveys as described in § 3.2 . Our FlowSN2 posteriors are compared against those obtained with the analytical likelihood solution derived in Appendix § 6 . Figure 5 shows near-exact agreement between the FlowSN2 posterior and the analytical solution posterior across our cosmology parameters and 13 SN population parameters. The illustrated naive posteriors, that do not take selection effects into account, are strongly biased, particularly for the cosmology and rate parameters. We find the Simple-BayeSN (Mandel et al. 2017) intrinsic SN parameters and extrinsic dust parameters are well-constrained and posteriors are in agreement with the analytical solution.
Figure 5. FlowSN2 posteriors on all our cosmological and SN population parameters. These inferences are using a pure-Ia sample with photometric redshifts under the influence of selection. We also show posteriors that use the analytical likelihood solution (defined in Appendix § 6 ) for the simplified model and the naive likelihood that does not take selection effects into account. This simulation is from cosmology C 2 \mathit{C}_2 C 2 showing FlowSN2 is still effective when inferring cosmological parameters away from the fiducial Λ \Lambda Λ CDM cosmology C f i d = C 1 \mathit{C}_{\mathrm{fid}} = \mathit{C}_1 C fid = C 1 used in training the normalising flows. The true value for each parameter is indicated by the solid black line.
The test simulations used in Figure 5 are generated from a different set of cosmological parameters C 2 \boldsymbol{C}_2 C 2 and SN rates than the fiducial C 1 \boldsymbol{C}_1 C 1 cosmology and rates used in training. This demonstrates a key advantage of the FlowSN2 framework, as training requires only a single assumed cosmology and rate. By contrast, other simulationbased inference (SBI) approaches to this problem require a hypercube spanning the full parameter space (Karchev et al. 2023b; Karchev & Trotta 2025).
To further investigate potential biases induced by our fiducial cosmology, we perform inference on simulations generated across five sets of cosmological parameters and rates. For each cosmology, we repeat the inference 25 times with different random seeds. The average posterior estimates and standard errors are reported in Table E1 and Table E2 . Cosmology C 1 \mathit{C}_1 C 1 represents the fiducial Λ \Lambda Λ CDM cosmology used in training, whereas C 2 \mathit{C}_2 C 2 and C 3 \mathit{C}_3 C 3 are simulated under a w w w CDM cosmology, lying below and above the fiducial parameters on the Hubble diagram respectively. For these three cosmological parameter sets, we find statistically insignificant biases below 2 σ 2\sigma 2 σ , falling within 0.2 σ 0.2\sigma 0.2 σ of the analytical solution. When combined with the CMB prior (defined in Appendix D1), our inferences remain robust, displaying negligible bias. By contrast, our previous analysis (Boyd et al. 2026) showed that BBC inferences (Kessler & Scolnic 2017) exhibited a ∼ 4 σ \sim4\sigma ∼ 4 σ bias toward the fiducial cosmology when combined with a CMB prior.
To demonstrate FlowSN2 ’s ability to infer parameters for alternative cosmological models without retraining, we infer w 0 w a w_0w_a w 0 w a CDM parameters in Table E2 . Parameters C 4 \mathit{C}_4 C 4 are equal to our fiducial parameters, while C 5 C_5 C 5 are closer to the parameters inferred in the recent DESI results (Adame et al. 2025). For additional constraining power we perform these inferences with a CMB and BAO prior as described in Appendix D. We find that again the FlowSN2 is able to infer the true cosmology under selection effects, with biases less than 0.1 σ 0.1\sigma 0.1 σ away from the analytical likelihood solution.
As reported in Table E1 and Table E2 , we find that the SN population parameters, including SN rates, are well-constrained, with the majority exhibiting statistically insignificant biases. The FlowSN2 framework also successfully recovers host-galaxy intrinsic mass steps to within 0.1 σ 0.1\sigma 0.1 σ of the analytical solution. The parameters exhibiting the largest relative deviations from the analytical solution are σ i n t \sigma_{\mathrm{int}} σ int and τ \tau τ , indicating that noisy variance parameters are the most challenging to learn. Nevertheless, the absolute magnitudes of these biases remain well within acceptable tolerances for the scientific objectives of next-generation surveys. Furthermore, when additional typing uncertainty is introduced in the subsequent experiment, these biases become statistically insignificant. We assess the empirical frequentist coverage properties of our Bayesian credible regions for a pure-Ia sample, as shown in the right column of Figure E1 . These checks confirm that inferences for all cosmological parameters and the thirteen SN parameters fall within the 95% Monte Carlo confidence bands.
Figure E1. Coverage of the FlowSN2 posteriors under photometric contamination, photometric redshift uncertainty and selection effects. Each panel shows the empirical coverage of every inferred parameter, pooled across the simulated cosmologies C 1 C_1 C 1 to C 5 C_5 C 5 , using N N N independent realisations. The left column resamples the objects (M = 5 M = 5 M = 5 ) with the modular Bayesian resampling treatment of the photometric classification probabilities, while the right column shows coverage using a pure SN Ia sample with the true labels. The middle row adds a CMB prior, while both CMB and BAO priors are added in the bottom row. Only the bottom row infers w a w_a w a , using the BAO prior, while the upper rows hold it fixed at w a = 0 w_a = 0 w a = 0 . The grey shaded region is the 95% Monte Carlo confidence band for the empirical coverage under perfect calibration.
Inference with Contamination
Experimental Setup
In this experiment we introduce contamination from non-SN Ia objects into our simulated test sample. The SNe Ia are simulated following exactly the procedure of § 3.1.1 . Contaminants are introduced only into the high-redshift photometric survey, since we model the low-redshift spectroscopic survey as spectroscopically confirmed SNe Ia.
We simulate the contaminants with the same generative forward model as the SNe Ia with the same underlying cosmological parameters, but give them different population parameters Θ S N n o n − I a \boldsymbol{\Theta}_{\mathrm{SN}}^{\mathrm{non-Ia}} Θ SN non − Ia , chosen to reflect the qualitative properties of core-collapse SNe (Vincenzi et al. 2021). Specifically, we assume the contaminants have no standardisation priors, with α = 0 \alpha=0 α = 0 , β i n t = 0 \beta_{\mathrm{int}}=0 β int = 0 and α c = 0 \alpha_c=0 α c = 0 , and a much larger intrinsic scatter of σ i n t = 1.2 \sigma_{\mathrm{int}}=1.2 σ int = 1.2 mag. We assume no correlation between host mass and object brightness, γ = 0 \gamma=0 γ = 0 . The contaminants are fainter than the SNe Ia by 0.4 0.4 0.4 mag, giving M 0 i n t = − 18.98 M_0^{\mathrm{int}}=-18.98 M 0 int = − 18.98 mag. It is this offset that particularly biases an analysis; without it, contamination would only inflate the scatter. Finally, we allow the contaminants to follow an alternative power-law rate, ϵ r a t e n o n − I a = 3.0 \epsilon_{\mathrm{rate}}^{\mathrm{non-Ia}}=3.0 ϵ rate non − Ia = 3.0 , so that the two populations have different redshift distributions.
Classification uses only the observed summary statistics d ^ s \hat{\boldsymbol{d}}_s d ^ s and redshifts z ^ s \hat{z}_s z ^ s . To demonstrate the method on a strongly contaminated sample, we deliberately give the contaminants the same light curve shape ( x 0 , σ x ) (x_0,\sigma_x) ( x 0 , σ x ) , intrinsic colour ( c 0 i n t , σ c , i n t ) (c_0^{\mathrm{int}},\sigma_{c,\mathrm{int}}) ( c 0 int , σ c , int ) and extrinsic dust ( τ , R B ) (\tau,R_B) ( τ , R B ) population distributions as the SNe Ia, so that the classes overlap in the observed summaries and cannot be separated on colour or light curve shape alone. We note that in reality, we do not expect such a strong population overlap, as it is possible to separate contaminants using apparent colour-magnitude distributions (Vincenzi et al. 2021).
Measurement errors and the survey selection (§ 3.1.1 ) are applied agnostically to the type of the object, so contaminants pass through exactly the same procedure as the SNe Ia. Of the ≈ 2500 \approx2500 ≈ 2500 contaminants simulated in the photometric survey, ≈ 500 \approx500 ≈ 500 pass the selection criteria. This gives ≈ 2800 \approx2800 ≈ 2800 selected objects in total, of which roughly 18% are contaminants. Figure 6 shows the distribution of mock classification scores for the selected objects, separated by their true class.
Figure 6. Mock classification scores for SNe Ia and contaminants in the high-redshift photometric sample used in our experiments. These are obtained using the known conditional class probabilities from the simulations. Further experimental details are in § 3.3.1 .
As described in § 2.9 , a sufficient condition for reliable inference is that, among selected SNe with similar observed light curve summaries and redshifts, the average classification score matches the fraction that are actually SNe Ia. In a real-data analysis, these scores may be obtained from a classifier trained on real data representative of the target population. In our simplified simulations, we instead compute the mock scores C s I a C_s^{\mathrm{Ia}} C s Ia using the exact conditional class probabilities from the known generative model, such that
C s I a = P ( Q s I a = 1 ∣ d ^ s , z ^ s , I s = 1 , Θ t r u e ) = π ˉ I a P ( d ^ s , z ^ s ∣ I s = 1 , Θ t r u e I a ) π ˉ I a P ( d ^ s , z ^ s ∣ I s = 1 , Θ t r u e I a ) + ( 1 − π ˉ I a ) P ( d ^ s , z ^ s ∣ I s = 1 , Θ t r u e n o n − I a ) (54) \begin{aligned}
C_s^{\mathrm{Ia}}=P(Q_s^{\mathrm{Ia}}=1\mid\hat{\boldsymbol{d}}_s,\hat{z}_s,I_s=1,\boldsymbol{\Theta}_{\mathrm{true}}) \\
&=\frac{\bar{\pi}_{\mathrm{Ia}}P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}_{\mathrm{true}}^{\mathrm{Ia}})}
{\bar{\pi}_{\mathrm{Ia}}P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}_{\mathrm{true}}^{\mathrm{Ia}})+(1-\bar{\pi}_{\mathrm{Ia}})P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}_{\mathrm{true}}^{\mathrm{non-Ia}})} \tag*{(54)}
\end{aligned} C s Ia = P ( Q s Ia = 1 ∣ d ^ s , z ^ s , I s = 1 , Θ true ) = π ˉ Ia P ( d ^ s , z ^ s ∣ I s = 1 , Θ true Ia ) + ( 1 − π ˉ Ia ) P ( d ^ s , z ^ s ∣ I s = 1 , Θ true non − Ia ) π ˉ Ia P ( d ^ s , z ^ s ∣ I s = 1 , Θ true Ia ) (54)
where we condition likelihoods on the true SN Ia global parameters Θ t r u e I a \boldsymbol{\Theta}_{\mathrm{true}}^{\mathrm{Ia}} Θ true Ia and the true non-Ia global parameters Θ t r u e n o n − I a \boldsymbol{\Theta}_{\mathrm{true}}^{\mathrm{non-Ia}} Θ true non − Ia . We derive P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}) P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) exactly for these simulations in Appendix § 6 . The SN Ia proportion post-selection π ˉ I a \bar{\pi}_{\mathrm{Ia}} π ˉ Ia can be calculated empirically given we know the true labels in the simulation. In practice, the photometric classification scores will come from classifiers trained on spectroscopically confirmed SNe Ia or simulations. The modular Bayesian resampling approach for handling contamination, along with alternative mixture model approaches (Kunz et al. 2007), will require classifier training data that is representative of, or at least provide support, over the high redshift photometric target population. This remains an open challenge for the field, where the solution will need to be tested in conjunction with the FlowSN2 framework.
Going forward in our experiments, we use these exact conditional classification probabilities as our mock classifier scores, following the methodology described in § 2.9 . We resample the data M = 5 M=5 M = 5 times based on these classification scores. Since the Bayesian approach of Autenrieth et al. (2026) does not require an explicit likelihood model for the non-Ia population, we use the same normalising flows trained on the pure-Ia simulations from the pure-Ia experiment, described in § 3.2 . We use the same SN Ia population parameters Θ S N I a \boldsymbol{\Theta}_{\mathrm{SN}}^{\mathrm{Ia}} Θ SN Ia as in the previous experiment, detailed in Table 1 and Table 2 . Our priors on the population parameters in inference, detailed in Table C1, are also the same. We repeat experiments again using five sets of cosmological parameters C 1 C_1 C 1 to C 5 C_5 C 5 .
Table 1. Average of posterior median estimates over 25 repeats and the standard error on this average for the full photometric SN Ia cosmology experiments with non-Ia contamination. We include results using our default modular Bayesian approach of resampling of the data (M = 5 M = 5 M = 5 ) to handle contamination, as well as results using the pure SN Ia sample with the true labels for comparison. Both use the FlowSN2 normalising flows in their inference. We also combine SNe with a CMB prior for additional constraining as detailed in Appendix D. Note uncertainties are the standard error on the average so are a factor of five smaller than those in individual experiments. The σ \sigma σ values are calculated using unrounded averages and standard errors.
Table 2.
Contamination Results
In these contamination experiments, we perform inference with the FlowSN2 normalising flow likelihood for SNe Ia exclusively. We compare results obtained across three regimes, using the biased full sample, the pure SN Ia subsample and the modular Bayesian resampling approach Autenrieth et al. 2026. Figure 7 shows the resulting posteriors for each case. When the full contaminated sample is analysed without accounting for contamination, the inferred SN population parameters, such as α \alpha α , β i n t \beta_{\rm int} β int , M 0 i n t M^{\rm int}_0 M 0 int and σ i n t \sigma_{\rm int} σ int , are most strongly affected. As a secondary consequence, the contaminated sample introduces a ∼ 1 σ \sim1\sigma ∼ 1 σ deviation in the w 0 − w a w_0-w_a w 0 − w a cosmological parameters despite guidance from the CMB and BAO priors, highlighting the critical need for robust non-Ia contamination mitigation in photometric SN cosmology.
Figure 7. FlowSN2 w 0 w a w_0w_a w 0 w a CDM posteriors under the influence of non-Ia contamination. We perform inference with all objects including contaminants to show how they can bias each parameter. We then include inferences using our default approach of modular Bayesian resampling (M = 5 M = 5 M = 5 ) of the data to account for contamination as described in § 2.9 . For comparison we include inferences on the pure SN Ia subsample using the true labels. Our experiments include a ∼ 18 % \sim18\% ∼ 18% post-selection contamination rate. Experimental details can be found in § 3.3.1 .
Figure 7 confirms that posteriors derived from the pure SN Ia sample successfully recover the true parameters, consistent with our findings in § 3.1 . We find that the resampled posterior shows close agreement with the pure SN Ia subsample posterior for both population and cosmological parameters. To further evaluate this performance, in Table 1 and Table 2 we repeated these tests across 25 realisations for each cosmological parameter set (C 1 C_1 C 1 through C 5 C_5 C 5 ), both with and without CMB and BAO priors. Cosmological parameter biases using this contaminated dataset remain within ∼ 2 σ \sim2\sigma ∼ 2 σ of the true values and fall within 0.8 σ 0.8\sigma 0.8 σ of the pure SN Ia subsample mean posterior estimates. We use M = 5 M = 5 M = 5 resamples in these experiments, noting that increasing M M M would improve the Monte Carlo accuracy of the resampling approximation. Here, the posterior widths from resampling closely match those using the pure SN Ia subsample. More generally, accounting for classification uncertainty through the resampling can broaden the posterior when fewer objects are retained in the resampled datasets Autenrieth et al. 2026. We again confirm the fiducial cosmology used during training exerts no influence on inferred cosmological biases and FlowSN2 reliably recovers SN Ia rates even when contaminant rates differ.
We evaluate the calibration properties of the FlowSN2 posteriors in Figure E1 , showing the frequentist empirical coverage of our Bayesian credible regions. None of the parameter posteriors in any of our experiments exhibit significant overconfidence. Resampled posteriors that account for contamination appear slightly conservative, with the tails for x 0 x_0 x 0 and σ c , i n t \sigma_{c,\mathrm{int}} σ c , int being broader. The cosmological parameters w 0 w_0 w 0 and Ω m \Omega_m Ω m are likewise conservative at the tails when constrained solely by SNe Ia and contaminants, but tighten once CMB and BAO priors are included. Further training is expected to refine this calibration, an avenue we reserve for future work on more realistic simulations.
Scaling
It is also important that our methodology scales to future sample sizes. For demonstration purposes, we repeat the contamination experiments of § 3.3.1 at increasing sample sizes, scaling the baseline of ≈ 2,000 \approx2{,}000 ≈ 2 , 000 SNe Ia and ≈ 500 \approx500 ≈ 500 contaminants up by factors of ten and fifty, to ≈ 20,000 \approx20{,}000 ≈ 20 , 000 SNe Ia with ≈ 5,000 \approx5{,}000 ≈ 5 , 000 contaminants and ≈ 100,000 \approx100{,}000 ≈ 100 , 000 SNe Ia with ≈ 25,000 \approx25{,}000 ≈ 25 , 000 contaminants. Both the low-redshift spectroscopic and high-redshift photometric samples are scaled by the same factor, preserving their relative sizes and the contaminant fraction. All experiments reuse the same four normalising flows trained for the pure-Ia analysis (§ 3.2 ), with no retraining.
The baseline sample of ≈ 2,500 \approx2{,}500 ≈ 2 , 500 objects takes around ten minutes per resample, totalling roughly 50 minutes for the M = 5 M = 5 M = 5 resamples. Since the modelled likelihood marginalises over individual latent SN parameters, the sampled dimension is fixed by the global parameters alone and does not grow with the sample size. Together with improved GPU utilisation at larger batch sizes, this makes the runtime scale sub-linearly with the number of objects. The ≈ 25,000 \approx25{,}000 ≈ 25 , 000 object inference completes in around five hours in total and the ≈ 125,000 \approx125{,}000 ≈ 125 , 000 object inference in around twenty hours, despite the tenfold and fiftyfold increases in sample size.
Figure 8 shows the three inferences for cosmology C 1 C_1 C 1 . The cosmological constraints tighten as the statistical errors shrink with sample size and all three recover the truth to within 2 σ 2\sigma 2 σ , demonstrating that the trained normalising flows remain accurate at scale. We find all 15 global parameters are successfully inferred at each scale within 3 σ 3\sigma 3 σ . Since likelihood approximation is re-used N o b s N_{\rm obs} N obs times, one might expect compounding errors in the approximation to lead to biased inferences, but this result shows us that inferences are still reliable at this scale. We conclude the method is scalable and ready for the next generation of SN Ia cosmology with large sample sizes.
Figure 8. Plot demonstrating the scalability of the FlowSN2 framework inferring cosmological parameters and key SN Ia parameters jointly on increasing sample sizes. These inferences were under the influence of selection effects, with 18% non-Ia contamination rate and with photometric redshifts. The straight lines represent the true parameters in the simulations.
Model Comparison
Parameter estimation answers how well a given model fits the data, but many of the open questions in SN Ia cosmology are instead questions of which model the data prefer. A convenient feature of these questions is that they are often nested models. A simpler null model M 0 \mathcal{M}_0 M 0 is recovered from a more complex model M 1 \mathcal{M}_1 M 1 by fixing a single parameter to a reference value, θ = θ 0 \theta= \theta_0 θ = θ 0 . Whether there is an intrinsic host-galaxy mass step, whether dark energy evolves and whether a colour-luminosity slope differs from its canonical value are all of this form.
The novelty of our approach is that we perform this model selection directly on a photometric sample, propagating photometric-redshift uncertainties, non-Ia contamination and survey selection effects consistently into the Bayes factor. Photometric redshifts are treated as data with their own likelihood rather than as fixed inputs, selection is built into the trained normalising flows by construction and contamination is accounted for through the modular Bayesian resampling approach of § 2.9 . Model selection then inherits all three treatments at no extra cost, since the Bayes factor is evaluated on exactly the same resampled posteriors used for parameter estimation.
For nested models, we compare M 0 \mathcal{M}_0 M 0 and M 1 \mathcal{M}_1 M 1 using the Savage-Dickey density ratio of Eq. (35) , interpreting the result on the Jeffreys’ scale Jeffreys 1961. The Bayes factor requires only the marginal posterior density of θ \theta θ under the more complex model, evaluated at θ 0 \theta_0 θ 0 , together with the prior density at the same point. We already produce that posterior when we fit M 1 \mathcal{M}_1 M 1 , so no additional sampling is needed. In the presence of contamination, we evaluate the ratio on the modular posterior as in Eq. (39) , reusing the same M = 5 M = 5 M = 5 resampled posteriors used for parameter estimation.
We validate this on simulations, where the true data-generating model is known. For each test we construct two sets of simulations, one drawn from the null model and one from the extended model, seeing whether the Bayes factor correctly favours the model that generated the data. We repeat each experiment over 25 independent realisations and report the mean of ln B F 1 , 0 \ln\mathrm{BF}_{1,0} ln BF 1 , 0 together with its standard error. Our results for both tests are summarised in Table 3 . The models compared here are by no means the only ones worth testing, since there are many variations of each. These experiments instead serve
Table 3.
Table 2. Average of posterior median estimates over 25 repeats and the standard error on this average for the full photometric SN Ia cosmology experiments with non-Ia contamination. Here we inference results on w 0 w a w_0w_a w 0 w a CDM model parameters. We include results using our default modular Bayesian approach of resampling of the data (M = 5 M = 5 M = 5 ) to handle contamination, as well as results using the pure SN Ia sample with the true labels for comparison. Both use the FlowSN2 normalising flows in their inference. In order to constrain the evolving dark energy model we include CMB and BAO priors as detailed in Appendix D. Note uncertainties are the standard error on the average so are a factor of five smaller than those in individual experiments. The σ \sigma σ values are calculated using unrounded averages and standard errors.
Table 3. Savage–Dickey Bayes factors for the nested model comparisons, each averaged over 25 simulated realisations with M = 5 M = 5 M = 5 label resamples per realisation. Uncertainties are the standard error on the mean ln B F 1 , 0 ′ \ln\mathrm{BF}'_{1,0} ln BF 1 , 0 ′ . Positive B F 1 , 0 ′ \mathrm{BF}'_{1,0} BF 1 , 0 ′ favours the model in which the parameter is free. Strength of evidence follows the Jeffreys scale. Experimental details can be found in § 3.5 .
to demonstrate how such model comparisons are carried out within the framework.
Dust or Intrinsic Mass Step?
Whether the environmental mass-step (Kelly et al. 2010; Sullivan et al. 2010) is intrinsic to the progenitor population or an extrinsic consequence of host-galaxy dust remains an open and important question, since an unmodelled or mis-attributed step propagates directly into inferred distances and therefore into cosmology. Brout & Scolnic (2021) argued that the step is entirely a dust effect, driven by host-mass-dependent dust properties, with more massive hosts being both dustier and having a lower dust relation parameter R B R_B R B . Using a hierarchical Bayesian SED model, Thorp & Mandel (2022) found, in contrast, that a residual intrinsic step of order 0.06 mag persists even once a mass-dependent dust distribution is taken into account. More recent work has found that the intrinsic step persists when applying the model to larger SN Ia datasets (Grayling et al. 2024; Grayling & Popovic 2025; Ginolin et al. 2026).
We cast the problem as a nested model comparison. The null model M 0 \mathcal{M}_0 M 0 allows the dust distribution to vary with host mass, but has no intrinsic step, γ = 0 \gamma= 0 γ = 0 . The extended model M 1 \mathcal{M}_1 M 1 additionally allows a free intrinsic step γ \gamma γ . To make the dust distribution host-mass dependent we split both the mean colour excess τ \tau τ and the R B R_B R B regimen parameter at the mass threshold M s t e p = 10 10 M ⊙ M_{\mathrm{step}} = 10^{10}\,M_{\odot} M step = 1 0 10 M ⊙ , following the qualitative picture of Brout & Scolnic (2021). Objects in high-mass hosts are simulated to have a larger τ \tau τ (0.098 against 0.068) and a lower R B R_B R B (3.0 against 3.7). The high-mass R B R_B R B is chosen to be within the training range, so is therefore more conservative than the value inferred by Brout & Scolnic (2021). Both flows are already amortised over per-object τ \tau τ and R B R_B R B , so the host-mass dependence is introduced with no retraining. We then simulate two datasets, one purely from varying dust (γ = 0 \gamma= 0 γ = 0 ) and one from varying dust together with an intrinsic step (γ = − 0.06 \gamma= -0.06 γ = − 0.06 ), the latter matching the residual step reported by Thorp & Mandel (2022).
The Bayes factors, given in Table 3 , recover the correct data-generating model in both cases. For the varying dust only simulations, the Bayes factor favours the null model, ln B F 1 , 0 ′ = − 2.92 ± 0.09 \ln\mathrm{BF}'_{1,0} = -2.92 \pm0.09 ln BF 1 , 0 ′ = − 2.92 ± 0.09 , which on the Jeffreys’ scale is strong evidence for γ = 0 \gamma= 0 γ = 0 . For the varying dust and intrinsic step simulations, it favours the extended model, ln B F 1 , 0 ′ = + 4.18 ± 0.62 \ln\mathrm{BF}'_{1,0} = +4.18 \pm0.62 ln BF 1 , 0 ′ = + 4.18 ± 0.62 , strong evidence for γ ≠ 0 \gamma\ne0 γ = 0 . In both cases the recovered model is the one that generated the data.
Constant or Evolving Dark Energy?
Whether the dark energy equation of state is constant (w a = 0 w_a = 0 w a = 0 ) or evolves with time (w a ≠ 0 w_a \ne0 w a = 0 ) is one of the most actively debated questions in current cosmology. Recent baryon acoustic oscillation (BAO) measurements from DESI, in combination with DES SNe Ia [28 ] and CMB data [104 ] , show a preference for an evolving equation of state under the w 0 w a w_0w_a w 0 w a CDM parameterisation at the ∼ 3 σ \sim3\sigma ∼ 3 σ level (Adame et al. 2025; Popovic et al. 2026b), a result that has attracted considerable attention as a possible departure from Λ \Lambda Λ CDM. This makes the constant versus evolving comparison a natural target for our framework.
Similar to Popovic et al. (2026b) and Ormondroyd et al. (2026), we use the Bayesian evidence to tell us which cosmological model the observations support. We treat this experiment as a nested test between the null model M 0 M_0 M 0 with w a = 0 w_a = 0 w a = 0 and the extended model M 1 M_1 M 1 with w a w_a w a free. SNe Ia alone constrain w 0 w a w_0w_a w 0 w a CDM parameters poorly, so for this test we combine the SN likelihood with the CMB and BAO priors described in Appendix D3. We simulate two datasets, one with constant dark energy (w a = 0 w_a = 0 w a = 0 ) and one with an evolving equation of state at the DESI DR2 best-fit value (w a = − 0.86 w_a = -0.86 w a = − 0.86 ).
The Bayes factors are given in Table 3 and recover the correct model in both cases. For the constant dark energy simulations, the Bayes factor favours the null model, ln B F 1 , 0 ′ = − 1.93 ± 0.15 \ln\mathrm{BF}^{\prime}_{1,0} = -1.93 \pm0.15 ln BF 1 , 0 ′ = − 1.93 ± 0.15 , substantial evidence for w a = 0 w_a = 0 w a = 0 . For the evolving dark energy simulations, it favours the extended model, ln B F 1 , 0 ′ = + 3.64 ± 0.47 \ln\mathrm{BF}^{\prime}_{1,0} = +3.64 \pm0.47 ln BF 1 , 0 ′ = + 3.64 ± 0.47 , strong evidence for w a ≠ 0 w_a \ne0 w a = 0 . This suggests that FlowSN2 could provide a powerful means of determining which dark energy model real data favour, whilst still accounting for selection effects, photometric redshifts and contamination.
Conclusions and Future Work
This work has shown that FlowSN2 is a powerful framework for inferring cosmological and population parameters under the influence of selection effects, photometric redshift uncertainties and contamination. FlowSN2 reframes SN Ia photometric cosmology from a regression problem to a joint inference problem where redshifts, alongside the light curves themselves, are treated as data. We validate that the posteriors are statistically motivated and equivalent to the analytical solution in tractable regimes. Furthermore, the methodology used for handling non-Ia contamination (Autenrieth et al. 2026) yields results that are in strong agreement with the pure SN Ia posteriors. Although this initial demonstration was conducted under simplified conditions, Boyd et al. (2026) showed that this line of work performs equally well in more complex regimes where no analytical solution exists.
With this new methodology, we are capable of reanalysing previous photometric studies, such as the full DES 5YR sample [28 ] . This will involve training the normalising flows on realistic simulations (Kessler et al. 2009; Rigault et al. 2026; Dai et al. 2026; Grayling 2026) before performing inference on the real data. Within this framework, survey-specific systematics can be modelled explicitly as covariates, or alternatively, if the systematics are poorly understood, we may average over posteriors from an ensemble of normalising flows trained on simulations where the systematic parameter varies. Our joint modelling of low and high redshift samples with varying data quality and selection effects demonstrates that this framework is a natural fit for analysing SN compilations from various surveys, such as Pantheon+ (Scolnic et al. 2022; Brout et al. 2022).
The FlowSN2 framework will be particularly valuable for the era of LSST (Ivezić et al. 2019) and Roman (Hounsell et al. 2018), as we have shown that it can scale up to over a hundred thousand SNe without retraining. The ongoing surveys will bring about challenging new systematics, such as varying survey selection. If each observing year involves discrete changes in strategy, we may train a set of normalising flows per year and trivially combine them at inference. If changes are more gradual and can be simulated faithfully, we can condition the likelihood approximation on the time of observation. Further work will be required to test the robustness of our framework against model misspecification, relying on a host of standardised tests developed by the SBI community (Anau Montel et al. 2025; O’Callaghan et al. 2025).
We demonstrated that FlowSN2 is able to model more complex SN Ia standardisations beyond the Tripp (1998) relationship using the Simple-BayesSN model (Mandel et al. 2017), separating intrinsic parameters from extrinsic dust parameters. It is straightforward to go one step further and use the full BayesSN (Mandel et al. 2022) SED parameter fits as summary statistics in our framework, mapping ( m ^ s , c ^ s , x ^ s ) → ( μ s , θ s , A V s ) (\hat{m}_s,\hat{c}_s,\hat{x}_s) \to(\mu_s,\theta_s,A_{V_s}) ( m ^ s , c ^ s , x ^ s ) → ( μ s , θ s , A V s ) . To enable further enhancements in SN standardisation, we may wish to include residual SED parameters ϵ s \epsilon_s ϵ s from Mandel et al. (2017) or learnt hybrid summary statistics (Makinen et al. 2024) in our modelling.
We demonstrated that at no extra cost, we can use the FlowSN2 posterior for Bayes factor calculations when comparing nested models. Current debates persist regarding whether the apparent SN host-galaxy mass step (Kelly et al. 2010; Sullivan et al. 2010; Lampeitl et al. 2010; Childress et al. 2013) stems from intrinsic progenitor differences or extrinsic dust differences in host-galaxy environments (Brout & Scolnic 2021; Thorp & Mandel 2022; Murakami & Scolnic 2025; Golin et al. 2025b). Most previous analyses were forced to evaluate this using volume-limited spectroscopic samples. We demonstrate through our “dust or intrinsic step” example that FlowSN2 is capable of identifying the correct generative forward model using photometric data while accounting for selection effects. In the future, we aim to incorporate additional complexity in host-galaxy modelling, as demonstrated in Karchev et al. (2026). Our modular SBI framework naturally allows upstream parameter dependencies to be changed without retraining the normalising flow that learns the downstream influence of selection on observed data.
The FlowSN2 framework provides unique advantages over other inference methodologies in the context of evolving dark energy debates (Adame et al. 2025; Efstathiou 2025; Vincenzi et al. 2025; Dhawan et al. 2025; Popovic et al. 2026b). The framework is amortised over the Hubble diagram, enabling us to infer parameters for any parameterisation of distance as a function of redshift. This allows us to naturally compare posterior constraints across different cosmological models under the influence of selection effects, contamination and photometric redshift uncertainties without retraining. As shown in Boyd et al. (2026), alternative approaches to handling selection effects can converge to different cosmological posteriors than those derived using this probabilistic prescription. Furthermore, we benefit from performing Bayesian model comparison in these settings at minimal additional computational cost. This scalable yet interpretable approach to SBI for SN cosmology will be a valuable tool in uncovering the nature of our Universe using data from the next generation of surveys.
Acknowledgements
We thank Konstantin Karchev and Richard Stiskalek for useful discussions related to this work.
BMB is supported by the Cambridge Centre for Doctoral Training in Data-Intensive Science funded by the UK Science and Technology Facilities Council (STFC) and two Research Early Career Researcher grants used for equipment and travel. BMB also acknowledges travel support provided by Christ’s College Cambridge’s Clayton Fund, LSST DESC supported by DOE funds administered by SLAC and STFC for UK participation in LSST through grant ST/S006206/1. Supernova and astrostatistics research at Cambridge University is supported in part by the European Union’s Horizon 2020 research and innovation programme under European Research Council Grant Agreement No. 101002652 (BayeSN; PI K. Mandel). ST has been supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement no. 101018897 CosmicExplorer). LK acknowledges support for an Early Career Fellowship from the Leverhulme Trust through grant ECF-2024-054 and the Isaac Newton Trust through grant 24.08(w).
DATA AVAILABILITY
The implementation of FlowSN2 and the experiments from this paper are publicly available at: https://github.com/bayesn/flowsn2 .
Analytical Derivation
Here we derive the analytical likelihood solution to a dusty Simple-BayeSN model (Mandel et al. 2017) under the influence of Gaussian cumulative distribution function (CDF) selection effects in both the magnitude and redshift axis. The generative forward model used in experiments is described in § 3.1.1 . The likelihood solution is used in § 3.1 as an analytical baseline and also in § 3.3 to provide perfect classification scores.
We begin by deriving the likelihood (conditioned on latent parameters) without selection effects
P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ S N ) = ∫ − ∞ ∞ ∫ − ∞ ∞ P ( d ^ s , z ^ s ∣ d s , z s , v p e c s ) P ( d s ∣ μ s , v p e c s , E s , Θ S N ) d d s d v p e c s = N ( ( d ^ s , z ^ s ) T ∣ ρ d s , W d ∣ E s ) (55) \begin{aligned}
P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid\mu_s,z_s,E_s,\boldsymbol{\Theta}_{\mathrm{SN}})
=
\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}
P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid\boldsymbol{d}_s,z_s,v_{\mathrm{pec}}^s)
P(\boldsymbol{d}_s\mid\mu_s,v_{\mathrm{pec}}^s,E_s,\boldsymbol{\Theta}_{\mathrm{SN}})
\,\mathrm{d}\boldsymbol{d}_s\,\mathrm{d}v_{\mathrm{pec}}^s \\
&= \mathcal{N}\left((\hat{\boldsymbol{d}}_s,\hat{z}_s)^T\mid\boldsymbol{\rho}_d^s,\mathbf{W}_{d\mid E}^s\right) \tag*{(55)}
\end{aligned} P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ SN ) = ∫ − ∞ ∞ ∫ − ∞ ∞ P ( d ^ s , z ^ s ∣ d s , z s , v pec s ) P ( d s ∣ μ s , v pec s , E s , Θ SN ) d d s d v pec s = N ( ( d ^ s , z ^ s ) T ∣ ρ d s , W d ∣ E s ) (55)
ρ d s = ( μ s + M 0 i n t + α x 0 + β i n t ( c 0 i n t + α c x 0 ) c 0 i n t + α c x 0 x 0 z s ) , ρ d ∣ E s = ( E [ m ^ s ∣ E s ] E [ c ^ s ∣ E s ] E [ x ^ s ] E [ z ^ s ] ) = ρ d s + E s ρ E , ρ E = ( R B 1 0 0 ) \boldsymbol{\rho}_d^s =
\begin{pmatrix}
\mu_s+M_0^{\mathrm{int}}+\alpha x_0+\beta_{\mathrm{int}}(c_0^{\mathrm{int}}+\alpha_c x_0)\\
c_0^{\mathrm{int}}+\alpha_c x_0\\
x_0\\
z_s
\end{pmatrix},
\qquad
\boldsymbol{\rho}_{d\mid E}^s =
\begin{pmatrix}
\mathbb{E}[\hat{m}_s\mid E_s]\\
\mathbb{E}[\hat{c}_s\mid E_s]\\
\mathbb{E}[\hat{x}_s]\\
\mathbb{E}[\hat{z}_s]
\end{pmatrix}
=
\boldsymbol{\rho}_d^s+E_s\boldsymbol{\rho}_E,
\qquad
\boldsymbol{\rho}_E=
\begin{pmatrix}
R_B\\
1\\
0\\
0
\end{pmatrix} ρ d s = μ s + M 0 int + α x 0 + β int ( c 0 int + α c x 0 ) c 0 int + α c x 0 x 0 z s , ρ d ∣ E s = E [ m ^ s ∣ E s ] E [ c ^ s ∣ E s ] E [ x ^ s ] E [ z ^ s ] = ρ d s + E s ρ E , ρ E = R B 1 0 0
W d ∣ E s = ( Var [ m ^ s ∣ E s ] Cov [ m ^ s , c ^ s ∣ E s ] Cov [ m ^ s , x ^ s ] Cov [ m ^ s , z ^ s ] Cov [ m ^ s , c ^ s ∣ E s ] Var [ c ^ s ∣ E s ] Cov [ c ^ s , x ^ s ] 0 Cov [ m ^ s , x ^ s ] Cov [ c ^ s , x ^ s ] Var [ x ^ s ] 0 Cov [ m ^ s , z ^ s ] 0 0 Var [ z ^ s ] ) \mathbf{W}_{d\mid E}^s =
\begin{pmatrix}
\operatorname{Var}[\hat{m}_s\mid E_s] & \operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid E_s] & \operatorname{Cov}[\hat{m}_s,\hat{x}_s] & \operatorname{Cov}[\hat{m}_s,\hat{z}_s]\\
\operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid E_s] & \operatorname{Var}[\hat{c}_s\mid E_s] & \operatorname{Cov}[\hat{c}_s,\hat{x}_s] & 0\\
\operatorname{Cov}[\hat{m}_s,\hat{x}_s] & \operatorname{Cov}[\hat{c}_s,\hat{x}_s] & \operatorname{Var}[\hat{x}_s] & 0\\
\operatorname{Cov}[\hat{m}_s,\hat{z}_s] & 0 & 0 & \operatorname{Var}[\hat{z}_s]
\end{pmatrix} W d ∣ E s = Var [ m ^ s ∣ E s ] Cov [ m ^ s , c ^ s ∣ E s ] Cov [ m ^ s , x ^ s ] Cov [ m ^ s , z ^ s ] Cov [ m ^ s , c ^ s ∣ E s ] Var [ c ^ s ∣ E s ] Cov [ c ^ s , x ^ s ] 0 Cov [ m ^ s , x ^ s ] Cov [ c ^ s , x ^ s ] Var [ x ^ s ] 0 Cov [ m ^ s , z ^ s ] 0 0 Var [ z ^ s ]
Var [ m ^ s ∣ E s ] = 100 σ p e c 2 ln ( 10 ) 2 c 2 + σ i n t 2 + β i n t 2 σ c , i n t 2 + ( α + β i n t α c ) 2 σ x 2 + Σ s m m \operatorname{Var}[\hat{m}_s\mid E_s]
=
\frac{100\sigma_{\mathrm{pec}}^2}{\ln(10)^2c^2}
+\sigma_{\mathrm{int}}^2+\beta_{\mathrm{int}}^2\sigma_{c,\mathrm{int}}^2
+(\alpha+\beta_{\mathrm{int}}\alpha_c)^2\sigma_x^2+\Sigma_s^{mm} Var [ m ^ s ∣ E s ] = ln ( 10 ) 2 c 2 100 σ pec 2 + σ int 2 + β int 2 σ c , int 2 + ( α + β int α c ) 2 σ x 2 + Σ s mm
Cov [ m ^ s , c ^ s ∣ E s ] = α α c σ x 2 + β i n t ( σ c , i n t 2 + α c 2 σ x 2 ) + Σ s m c \operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid E_s]
=
\alpha\alpha_c\sigma_x^2+\beta_{\mathrm{int}}(\sigma_{c,\mathrm{int}}^2+\alpha_c^2\sigma_x^2)+\Sigma_s^{mc} Cov [ m ^ s , c ^ s ∣ E s ] = α α c σ x 2 + β int ( σ c , int 2 + α c 2 σ x 2 ) + Σ s m c
Cov [ m ^ s , x ^ s ] = α σ x 2 + β i n t α c σ x 2 + Σ s m x \operatorname{Cov}[\hat{m}_s,\hat{x}_s]
=
\alpha\sigma_x^2+\beta_{\mathrm{int}}\alpha_c\sigma_x^2+\Sigma_s^{mx} Cov [ m ^ s , x ^ s ] = α σ x 2 + β int α c σ x 2 + Σ s m x
Var [ c ^ s ∣ E s ] = σ c , i n t 2 + α c 2 σ x 2 + Σ s c c \operatorname{Var}[\hat{c}_s\mid E_s]
=
\sigma_{c,\mathrm{int}}^2+\alpha_c^2\sigma_x^2+\Sigma_s^{cc} Var [ c ^ s ∣ E s ] = σ c , int 2 + α c 2 σ x 2 + Σ s cc
Cov [ c ^ s , x ^ s ] = α c σ x 2 + Σ s c x \operatorname{Cov}[\hat{c}_s,\hat{x}_s]
=
\alpha_c\sigma_x^2+\Sigma_s^{cx} Cov [ c ^ s , x ^ s ] = α c σ x 2 + Σ s c x
Var [ x ^ s ] = σ x 2 + Σ s x x \operatorname{Var}[\hat{x}_s]
=
\sigma_x^2+\Sigma_s^{xx} Var [ x ^ s ] = σ x 2 + Σ s xx
Cov [ m ^ s , z ^ s ] = 10 σ p e c 2 ln ( 10 ) c 2 \operatorname{Cov}[\hat{m}_s,\hat{z}_s]
=
\frac{10\sigma_{\mathrm{pec}}^2}{\ln(10)c^2} Cov [ m ^ s , z ^ s ] = ln ( 10 ) c 2 10 σ pec 2
Var [ z ^ s ] = σ p e c 2 c 2 + σ z , s 2 \operatorname{Var}[\hat{z}_s]
=
\frac{\sigma_{\mathrm{pec}}^2}{c^2}+\sigma_{z,s}^2 Var [ z ^ s ] = c 2 σ pec 2 + σ z , s 2
We can now define two selection probabilities in terms of the observed summary parameters and observed redshifts
P ( I s = 1 ∣ d ^ s ) = Φ ( m c u t − ( m ^ s + a c u t , m x ^ s + b c u t , m c ^ s ) σ c u t , m ) , P ( I s = 1 ∣ z ^ s ) = Φ ( z c u t − z ^ s σ c u t , z ) (56) P(I_s=1\mid\hat{\boldsymbol{d}}_s)
=
\Phi\left(
\frac{m_{\mathrm{cut}}-(\hat{m}_s+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}\hat{c}_s)}
{\sigma_{\mathrm{cut},m}}
\right),
\qquad
P(I_s=1\mid\hat{z}_s)
=
\Phi\left(
\frac{z_{\mathrm{cut}}-\hat{z}_s}
{\sigma_{\mathrm{cut},z}}
\right) \tag*{(56)} P ( I s = 1 ∣ d ^ s ) = Φ ( σ cut , m m cut − ( m ^ s + a cut , m x ^ s + b cut , m c ^ s ) ) , P ( I s = 1 ∣ z ^ s ) = Φ ( σ cut , z z cut − z ^ s ) (56)
where Φ ( ⋅ ) \Phi(\cdot) Φ ( ⋅ ) is a Gaussian cumulative distribution function. The colour excess E s E_s E s has an exponential prior parametrised by average τ \tau τ
P ( E s ∣ τ ) = 1 τ exp ( − E s / τ ) . (57) P(E_s\mid\tau)=\frac{1}{\tau}\exp(-E_s/\tau). \tag*{(57)} P ( E s ∣ τ ) = τ 1 exp ( − E s / τ ) . (57)
The analytical selected likelihood marginalised over dust is
P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ S N ) = P ( I s = 1 ∣ d ^ s ) P ( I s = 1 ∣ z ^ s ) ∫ 0 ∞ P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ S N ) P ( E s ∣ τ ) d E s ∫ 0 ∞ ∫ 0 ∞ ∫ − ∞ ∞ P ( I s = 1 ∣ d ^ s ) P ( I s = 1 ∣ z ^ s ) P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ S N ) P ( E s ∣ τ ) d d ^ s d z ^ s d E s = A B . (58) P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\mu_s,z_s,\boldsymbol{\Theta}_{\mathrm{SN}})
=
\frac{
P(I_s=1\mid\hat{\boldsymbol{d}}_s)P(I_s=1\mid\hat{z}_s)
\int_0^\infty P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid\mu_s,z_s,E_s,\boldsymbol{\Theta}_{\mathrm{SN}})P(E_s\mid\tau)\,\mathrm{d}E_s
}{
\int_0^\infty\int_0^\infty\int_{-\infty}^{\infty}
P(I_s=1\mid\hat{\boldsymbol{d}}_s)P(I_s=1\mid\hat{z}_s)
P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid\mu_s,z_s,E_s,\boldsymbol{\Theta}_{\mathrm{SN}})
P(E_s\mid\tau)\,\mathrm{d}\hat{\boldsymbol{d}}_s\,\mathrm{d}\hat{z}_s\,\mathrm{d}E_s
}
=
\frac{\mathcal{A}}{\mathcal{B}}. \tag*{(58)} P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ SN ) = ∫ 0 ∞ ∫ 0 ∞ ∫ − ∞ ∞ P ( I s = 1 ∣ d ^ s ) P ( I s = 1 ∣ z ^ s ) P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ SN ) P ( E s ∣ τ ) d d ^ s d z ^ s d E s P ( I s = 1 ∣ d ^ s ) P ( I s = 1 ∣ z ^ s ) ∫ 0 ∞ P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ SN ) P ( E s ∣ τ ) d E s = B A . (58)
The numerator A \mathcal{A} A is
A = P ( I s = 1 ∣ d ^ s ) P ( I s = 1 ∣ z ^ s ) ∣ 2 π S s 2 ∣ 1 / 2 τ N ( ( d ^ s , z ^ s ) T ∣ ρ d s + ρ E E ^ s , W d ∣ E s ) exp [ 1 2 ( s E τ ) 2 − E ^ s τ ] Φ ( E ^ s s E − s E τ ) (59) \mathcal{A}
=
P(I_s=1\mid\hat{\boldsymbol{d}}_s)P(I_s=1\mid\hat{z}_s)
\frac{|2\pi\mathbf{S}_s^2|^{1/2}}{\tau}
\mathcal{N}\left((\hat{\boldsymbol{d}}_s,\hat{z}_s)^T\mid\boldsymbol{\rho}_d^s+\boldsymbol{\rho}_E\hat{E}_s,\mathbf{W}_{d\mid E}^s\right)
\exp\left[\frac{1}{2}\left(\frac{s_E}{\tau}\right)^2-\frac{\hat{E}_s}{\tau}\right]
\Phi\left(\frac{\hat{E}_s}{s_E}-\frac{s_E}{\tau}\right) \tag*{(59)} A = P ( I s = 1 ∣ d ^ s ) P ( I s = 1 ∣ z ^ s ) τ ∣2 π S s 2 ∣ 1/2 N ( ( d ^ s , z ^ s ) T ∣ ρ d s + ρ E E ^ s , W d ∣ E s ) exp [ 2 1 ( τ s E ) 2 − τ E ^ s ] Φ ( s E E ^ s − τ s E ) (59)
s E − 2 ≡ ρ E T ( W d ∣ E s ) − 1 ρ E , E ^ s ≡ s E 2 ρ E T ( W d ∣ E s ) − 1 ( ( d ^ s , z ^ s ) T − ρ d s ) . s_E^{-2}\equiv\boldsymbol{\rho}_E^T(\mathbf{W}_{d\mid E}^s)^{-1}\boldsymbol{\rho}_E,
\qquad
\hat{E}_s\equiv s_E^2\boldsymbol{\rho}_E^T(\mathbf{W}_{d\mid E}^s)^{-1}
\left((\hat{\boldsymbol{d}}_s,\hat{z}_s)^T-\boldsymbol{\rho}_d^s\right). s E − 2 ≡ ρ E T ( W d ∣ E s ) − 1 ρ E , E ^ s ≡ s E 2 ρ E T ( W d ∣ E s ) − 1 ( ( d ^ s , z ^ s ) T − ρ d s ) .
To solve the denominator B \mathcal{B} B we first rewrite Eq. (55) using the conditional properties of multivariate Gaussians
P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ S N ) = N ( ( d ^ s , z ^ s ) T ∣ ρ d ∣ E s , W d ∣ E s ) = N ( m ^ s ∣ E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] , Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] ) N ( c ^ s ∣ E [ c ^ s ∣ x ^ s , E s ] , Var [ c ^ s ∣ x ^ s , E s ] ) N ( x ^ s ∣ E [ x ^ s ] , Var [ x ^ s ] ) N ( z ^ s ∣ E [ z ^ s ] , Var [ z ^ s ] ) , (60) \begin{aligned}
P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid\mu_s,z_s,E_s,\boldsymbol{\Theta}_{\mathrm{SN}})=N\left((\hat{\boldsymbol{d}}_s,\hat{z}_s)^{T}\mid\rho_{d|E}^{s},W_{d|E}^{s}\right) \\
&=N\left(\hat{m}_s\mid\mathbb{E}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s],\operatorname{Var}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s]\right)N\left(\hat{c}_s\mid\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s],\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]\right)N\left(\hat{x}_s\mid\mathbb{E}[\hat{x}_s],\operatorname{Var}[\hat{x}_s]\right)N\left(\hat{z}_s\mid\mathbb{E}[\hat{z}_s],\operatorname{Var}[\hat{z}_s]\right), \tag*{(60)}
\end{aligned} P ( d ^ s , z ^ s ∣ μ s , z s , E s , Θ SN ) = N ( ( d ^ s , z ^ s ) T ∣ ρ d ∣ E s , W d ∣ E s ) = N ( m ^ s ∣ E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] , Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] ) N ( c ^ s ∣ E [ c ^ s ∣ x ^ s , E s ] , Var [ c ^ s ∣ x ^ s , E s ] ) N ( x ^ s ∣ E [ x ^ s ] , Var [ x ^ s ] ) N ( z ^ s ∣ E [ z ^ s ] , Var [ z ^ s ] ) , (60)
E [ c ^ s ∣ x ^ s , E s ] = E [ c ^ s ∣ E s ] + Cov [ c ^ s , x ^ s ] Var [ x ^ s ] ( x ^ s − E [ x ^ s ] ) , Var [ c ^ s ∣ x ^ s , E s ] = Var [ c ^ s ∣ E s ] − Cov [ c ^ s , x ^ s ] 2 Var [ x ^ s ] , E [ m ^ s ∣ x ^ s , E s ] = E [ m ^ s ∣ E s ] + Cov [ m ^ s , x ^ s ] Var [ x ^ s ] ( x ^ s − E [ x ^ s ] ) , Var [ m ^ s ∣ x ^ s , E s ] = Var [ m ^ s ∣ E s ] − Cov [ m ^ s , x ^ s ] 2 Var [ x ^ s ] , Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] = Cov [ m ^ s , c ^ s ∣ E s ] − Cov [ m ^ s , x ^ s ] Cov [ c ^ s , x ^ s ] Var [ x ^ s ] , E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] = E [ m ^ s ∣ x ^ s , E s ] + Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] Var [ c ^ s ∣ x ^ s , E s ] ( c ^ s − E [ c ^ s ∣ x ^ s , E s ] ) + Cov [ m ^ s , z ^ s ] Var [ z ^ s ] ( z ^ s − E [ z ^ s ] ) , Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] = Var [ m ^ s ∣ x ^ s , E s ] − Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] 2 Var [ c ^ s ∣ x ^ s , E s ] − Cov [ m ^ s , z ^ s ] 2 Var [ z ^ s ] . \begin{aligned}
\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s]&=\mathbb{E}[\hat{c}_s\mid E_s]+\frac{\operatorname{Cov}[\hat{c}_s,\hat{x}_s]}{\operatorname{Var}[\hat{x}_s]}\left(\hat{x}_s-\mathbb{E}[\hat{x}_s]\right),\\
\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]&=\operatorname{Var}[\hat{c}_s\mid E_s]-\frac{\operatorname{Cov}[\hat{c}_s,\hat{x}_s]^2}{\operatorname{Var}[\hat{x}_s]},\\
\mathbb{E}[\hat{m}_s\mid\hat{x}_s,E_s]&=\mathbb{E}[\hat{m}_s\mid E_s]+\frac{\operatorname{Cov}[\hat{m}_s,\hat{x}_s]}{\operatorname{Var}[\hat{x}_s]}\left(\hat{x}_s-\mathbb{E}[\hat{x}_s]\right),\\
\operatorname{Var}[\hat{m}_s\mid\hat{x}_s,E_s]&=\operatorname{Var}[\hat{m}_s\mid E_s]-\frac{\operatorname{Cov}[\hat{m}_s,\hat{x}_s]^2}{\operatorname{Var}[\hat{x}_s]},\\
\operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid\hat{x}_s,E_s]&=\operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid E_s]-\frac{\operatorname{Cov}[\hat{m}_s,\hat{x}_s]\operatorname{Cov}[\hat{c}_s,\hat{x}_s]}{\operatorname{Var}[\hat{x}_s]},\\
\mathbb{E}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s]&=\mathbb{E}[\hat{m}_s\mid\hat{x}_s,E_s]+\frac{\operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid\hat{x}_s,E_s]}{\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]}\left(\hat{c}_s-\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s]\right)\\
&\quad+\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]}{\operatorname{Var}[\hat{z}_s]}\left(\hat{z}_s-\mathbb{E}[\hat{z}_s]\right),\\
\operatorname{Var}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s]&=\operatorname{Var}[\hat{m}_s\mid\hat{x}_s,E_s]-\frac{\operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid\hat{x}_s,E_s]^2}{\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]}-\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]^2}{\operatorname{Var}[\hat{z}_s]}.
\end{aligned} E [ c ^ s ∣ x ^ s , E s ] Var [ c ^ s ∣ x ^ s , E s ] E [ m ^ s ∣ x ^ s , E s ] Var [ m ^ s ∣ x ^ s , E s ] Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] = E [ c ^ s ∣ E s ] + Var [ x ^ s ] Cov [ c ^ s , x ^ s ] ( x ^ s − E [ x ^ s ] ) , = Var [ c ^ s ∣ E s ] − Var [ x ^ s ] Cov [ c ^ s , x ^ s ] 2 , = E [ m ^ s ∣ E s ] + Var [ x ^ s ] Cov [ m ^ s , x ^ s ] ( x ^ s − E [ x ^ s ] ) , = Var [ m ^ s ∣ E s ] − Var [ x ^ s ] Cov [ m ^ s , x ^ s ] 2 , = Cov [ m ^ s , c ^ s ∣ E s ] − Var [ x ^ s ] Cov [ m ^ s , x ^ s ] Cov [ c ^ s , x ^ s ] , = E [ m ^ s ∣ x ^ s , E s ] + Var [ c ^ s ∣ x ^ s , E s ] Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] ( c ^ s − E [ c ^ s ∣ x ^ s , E s ] ) + Var [ z ^ s ] Cov [ m ^ s , z ^ s ] ( z ^ s − E [ z ^ s ] ) , = Var [ m ^ s ∣ x ^ s , E s ] − Var [ c ^ s ∣ x ^ s , E s ] Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] 2 − Var [ z ^ s ] Cov [ m ^ s , z ^ s ] 2 .
The three dimensions can be marginalised over using the identity
∫ − ∞ ∞ Φ ( μ 1 − x σ 1 ) N ( x ∣ μ 2 , σ 2 2 ) d x = Φ ( μ 1 − μ 2 σ 1 ( 1 + σ 2 2 σ 1 2 ) − 1 2 ) . (61) \int_{-\infty}^{\infty}\Phi\left(\frac{\mu_1-x}{\sigma_1}\right)N(x\mid\mu_2,\sigma_2^2)\,dx=\Phi\left(\frac{\mu_1-\mu_2}{\sigma_1}\left(1+\frac{\sigma_2^2}{\sigma_1^2}\right)^{-\frac{1}{2}}\right). \tag*{(61)} ∫ − ∞ ∞ Φ ( σ 1 μ 1 − x ) N ( x ∣ μ 2 , σ 2 2 ) d x = Φ ( σ 1 μ 1 − μ 2 ( 1 + σ 1 2 σ 2 2 ) − 2 1 ) . (61)
The first dimension m ^ s \hat{m}_s m ^ s is integrated to get
∫ − ∞ ∞ Φ ( m c u t − ( m ^ s + a c u t , m x ^ s + b c u t , m c ^ s ) σ c u t , m ) N ( m ^ s ∣ E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] , Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] ) d m ^ s = Φ ( m c u t − ( E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] + a c u t , m x ^ s + b c u t , m c ^ s ) σ c u t , m ′ ) , (62) \begin{aligned}
\int_{-\infty}^{\infty}\Phi\left(\frac{m_{\mathrm{cut}}-(\hat{m}_s+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}\hat{c}_s)}{\sigma_{\mathrm{cut},m}}\right)N\left(\hat{m}_s\mid\mathbb{E}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s],\operatorname{Var}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s]\right)d\hat{m}_s \\
&=\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s]+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}\hat{c}_s\right)}{\sigma'_{\mathrm{cut},m}}\right), \tag*{(62)}
\end{aligned} ∫ − ∞ ∞ Φ ( σ cut , m m cut − ( m ^ s + a cut , m x ^ s + b cut , m c ^ s ) ) N ( m ^ s ∣ E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] , Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] ) d m ^ s = Φ ( σ cut , m ′ m cut − ( E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] + a cut , m x ^ s + b cut , m c ^ s ) ) , (62)
with
σ c u t , m ′ = σ c u t , m 2 + Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] . \sigma'_{\mathrm{cut},m}=\sqrt{\sigma_{\mathrm{cut},m}^{2}+\operatorname{Var}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s]}. σ cut , m ′ = σ cut , m 2 + Var [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] .
The second dimension c ^ s \hat{c}_s c ^ s is then integrated out to get
∫ − ∞ ∞ Φ ( m c u t − ( E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] + a c u t , m x ^ s + b c u t , m c ^ s ) σ c u t , m ′ ) N ( c ^ s ∣ E [ c ^ s ∣ x ^ s , E s ] , Var [ c ^ s ∣ x ^ s , E s ] ) d c ^ s = ∫ − ∞ ∞ Φ ( m c u t − ( E [ m ^ s ∣ x ^ s , E s ] + γ c ( c ^ s − E [ c ^ s ∣ x ^ s , E s ] ) + γ z ( z ^ s − E [ z ^ s ] ) + a c u t , m x ^ s + b c u t , m c ^ s ) σ c u t , m ′ ) N ( c ^ s ∣ E [ c ^ s ∣ x ^ s , E s ] , Var [ c ^ s ∣ x ^ s , E s ] ) d c ^ s = Φ ( m c u t − ( E [ m ^ s ∣ x ^ s , E s ] − γ c E [ c ^ s ∣ x ^ s , E s ] + a c u t , m x ^ s + ( b c u t , m + γ c ) E [ c ^ s ∣ x ^ s , E s ] + γ z ( z ^ s − E [ z ^ s ] ) ) σ c u t , m ′ ′ ) = Φ ( m c u t − ( E [ m ^ s ∣ x ^ s , E s ] + a c u t , m x ^ s + b c u t , m E [ c ^ s ∣ x ^ s , E s ] + γ z ( z ^ s − E [ z ^ s ] ) ) σ c u t , m ′ ′ ) , (63) \begin{aligned}
&\int_{-\infty}^{\infty}\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid\hat{c}_s,\hat{x}_s,\hat{z}_s,E_s]+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}\hat{c}_s\right)}{\sigma'_{\mathrm{cut},m}}\right)N\left(\hat{c}_s\mid\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s],\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]\right)d\hat{c}_s\\
&=\int_{-\infty}^{\infty}\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid\hat{x}_s,E_s]+\gamma_c(\hat{c}_s-\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s])+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}\hat{c}_s\right)}{\sigma'_{\mathrm{cut},m}}\right)N\left(\hat{c}_s\mid\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s],\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]\right)d\hat{c}_s\\
&=\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid\hat{x}_s,E_s]-\gamma_c\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s]+a_{\mathrm{cut},m}\hat{x}_s+(b_{\mathrm{cut},m}+\gamma_c)\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s]+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])\right)}{\sigma''_{\mathrm{cut},m}}\right)\\
&=\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid\hat{x}_s,E_s]+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s]+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])\right)}{\sigma''_{\mathrm{cut},m}}\right), \tag*{(63)}
\end{aligned} ∫ − ∞ ∞ Φ ( σ cut , m ′ m cut − ( E [ m ^ s ∣ c ^ s , x ^ s , z ^ s , E s ] + a cut , m x ^ s + b cut , m c ^ s ) ) N ( c ^ s ∣ E [ c ^ s ∣ x ^ s , E s ] , Var [ c ^ s ∣ x ^ s , E s ] ) d c ^ s = ∫ − ∞ ∞ Φ ( σ cut , m ′ m cut − ( E [ m ^ s ∣ x ^ s , E s ] + γ c ( c ^ s − E [ c ^ s ∣ x ^ s , E s ]) + γ z ( z ^ s − E [ z ^ s ]) + a cut , m x ^ s + b cut , m c ^ s ) ) N ( c ^ s ∣ E [ c ^ s ∣ x ^ s , E s ] , Var [ c ^ s ∣ x ^ s , E s ] ) d c ^ s = Φ ( σ cut , m ′′ m cut − ( E [ m ^ s ∣ x ^ s , E s ] − γ c E [ c ^ s ∣ x ^ s , E s ] + a cut , m x ^ s + ( b cut , m + γ c ) E [ c ^ s ∣ x ^ s , E s ] + γ z ( z ^ s − E [ z ^ s ]) ) ) = Φ ( σ cut , m ′′ m cut − ( E [ m ^ s ∣ x ^ s , E s ] + a cut , m x ^ s + b cut , m E [ c ^ s ∣ x ^ s , E s ] + γ z ( z ^ s − E [ z ^ s ]) ) ) , (63)
where
σ c u t , m ′ ′ = σ c u t , m ′ 2 + ( b c u t , m + γ c ) 2 Var [ c ^ s ∣ x ^ s , E s ] , γ c = Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] Var [ c ^ s ∣ x ^ s , E s ] , γ z = Cov [ m ^ s , z ^ s ] Var [ z ^ s ] . \sigma''_{\mathrm{cut},m}=\sqrt{\sigma_{\mathrm{cut},m}^{\prime2}+(b_{\mathrm{cut},m}+\gamma_c)^2\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]},\qquad
\gamma_c=\frac{\operatorname{Cov}[\hat{m}_s,\hat{c}_s\mid\hat{x}_s,E_s]}{\operatorname{Var}[\hat{c}_s\mid\hat{x}_s,E_s]},\qquad
\gamma_z=\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]}{\operatorname{Var}[\hat{z}_s]}. σ cut , m ′′ = σ cut , m ′2 + ( b cut , m + γ c ) 2 Var [ c ^ s ∣ x ^ s , E s ] , γ c = Var [ c ^ s ∣ x ^ s , E s ] Cov [ m ^ s , c ^ s ∣ x ^ s , E s ] , γ z = Var [ z ^ s ] Cov [ m ^ s , z ^ s ] .
Then the third dimension x ^ s \hat{x}_s x ^ s is integrated to get
∫ − ∞ ∞ Φ ( m c u t − ( E [ m ^ s ∣ x ^ s , E s ] + a c u t , m x ^ s + b c u t , m E [ c ^ s ∣ x ^ s , E s ] + γ z ( z ^ s − E [ z ^ s ] ) ) σ c u t , m ′ ′ ′ ) N ( x ^ s ∣ E [ x ^ s ] , Var [ x ^ s ] ) d x ^ s = ∫ − ∞ ∞ Φ ( m c u t − ( E [ m ^ s ∣ E s ] + γ x ( x ^ s − E [ x ^ s ] ) + a c u t , m x ^ s + b c u t , m ( E [ c ^ s ∣ E s ] + δ x ( x ^ s − E [ x ^ s ] ) ) + γ z ( z ^ s − E [ z ^ s ] ) ) σ c u t , m ′ ′ ′ ) N ( x ^ s ∣ E [ x ^ s ] , Var [ x ^ s ] ) d x ^ s = Φ ( m c u t − ( E [ m ^ s ∣ E s ] − γ x E [ x ^ s ] + ( a c u t , m + γ x + δ x b c u t , m ) E [ x ^ s ] + b c u t , m ( E [ c ^ s ∣ E s ] − δ x E [ x ^ s ] ) + γ z ( z ^ s − E [ z ^ s ] ) ) σ c u t , m ′ ′ ′ ) = Φ ( m c u t − ( E [ m ^ s ∣ E s ] + a c u t , m E [ x ^ s ] + b c u t , m E [ c ^ s ∣ E s ] + γ z ( z ^ s − E [ z ^ s ] ) ) σ c u t , m ′ ′ ′ ) , (64) \begin{aligned}
&\int_{-\infty}^{\infty} \Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid\hat{x}_s,E_s]+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}\mathbb{E}[\hat{c}_s\mid\hat{x}_s,E_s]+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])\right)}{\sigma'''_{\mathrm{cut},m}}\right)N(\hat{x}_s\mid\mathbb{E}[\hat{x}_s],\operatorname{Var}[\hat{x}_s])\,\mathrm{d}\hat{x}_s\\
&=\int_{-\infty}^{\infty}\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid E_s]+\gamma_x(\hat{x}_s-\mathbb{E}[\hat{x}_s])+a_{\mathrm{cut},m}\hat{x}_s+b_{\mathrm{cut},m}(\mathbb{E}[\hat{c}_s\mid E_s]+\delta_x(\hat{x}_s-\mathbb{E}[\hat{x}_s]))+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])\right)}{\sigma'''_{\mathrm{cut},m}}\right)N(\hat{x}_s\mid\mathbb{E}[\hat{x}_s],\operatorname{Var}[\hat{x}_s])\,\mathrm{d}\hat{x}_s\\
&=\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid E_s]-\gamma_x\mathbb{E}[\hat{x}_s]+(a_{\mathrm{cut},m}+\gamma_x+\delta_xb_{\mathrm{cut},m})\mathbb{E}[\hat{x}_s]+b_{\mathrm{cut},m}(\mathbb{E}[\hat{c}_s\mid E_s]-\delta_x\mathbb{E}[\hat{x}_s])+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])\right)}{\sigma'''_{\mathrm{cut},m}}\right)\\
&=\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid E_s]+a_{\mathrm{cut},m}\mathbb{E}[\hat{x}_s]+b_{\mathrm{cut},m}\mathbb{E}[\hat{c}_s\mid E_s]+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])\right)}{\sigma'''_{\mathrm{cut},m}}\right), \tag*{(64)}
\end{aligned} ∫ − ∞ ∞ Φ ( σ cut , m ′′′ m cut − ( E [ m ^ s ∣ x ^ s , E s ] + a cut , m x ^ s + b cut , m E [ c ^ s ∣ x ^ s , E s ] + γ z ( z ^ s − E [ z ^ s ]) ) ) N ( x ^ s ∣ E [ x ^ s ] , Var [ x ^ s ]) d x ^ s = ∫ − ∞ ∞ Φ ( σ cut , m ′′′ m cut − ( E [ m ^ s ∣ E s ] + γ x ( x ^ s − E [ x ^ s ]) + a cut , m x ^ s + b cut , m ( E [ c ^ s ∣ E s ] + δ x ( x ^ s − E [ x ^ s ])) + γ z ( z ^ s − E [ z ^ s ]) ) ) N ( x ^ s ∣ E [ x ^ s ] , Var [ x ^ s ]) d x ^ s = Φ ( σ cut , m ′′′ m cut − ( E [ m ^ s ∣ E s ] − γ x E [ x ^ s ] + ( a cut , m + γ x + δ x b cut , m ) E [ x ^ s ] + b cut , m ( E [ c ^ s ∣ E s ] − δ x E [ x ^ s ]) + γ z ( z ^ s − E [ z ^ s ]) ) ) = Φ ( σ cut , m ′′′ m cut − ( E [ m ^ s ∣ E s ] + a cut , m E [ x ^ s ] + b cut , m E [ c ^ s ∣ E s ] + γ z ( z ^ s − E [ z ^ s ]) ) ) , (64)
where
\sigma'''_{\mathrm{cut},m}=\sqrt{\sigma''_{\mathrm{cut},m}^{2}+(a_{\mathrm{cut},m}+\gamma_x+\delta_xb_{\mathrm{cut},m})^{2}\operatorname{Var}[\hat{x}_s]},\qquad
\gamma_x=\frac{\operatorname{Cov}[\hat{m}_s,\hat{x}_s]}{\operatorname{Var}[\hat{x}_s]},\qquad
\delta_x=\frac{\operatorname{Cov}[\hat{c}_s,\hat{x}_s]}{\operatorname{Var}[\hat{x}_s]}.
Next we integrate out z ^ s \hat{z}_s z ^ s to get
\begin{aligned}
&\int_{0}^{\infty}\Phi\left(\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid E_s]+a_{\mathrm{cut},m}\mathbb{E}[\hat{x}_s]+b_{\mathrm{cut},m}\mathbb{E}[\hat{c}_s\mid E_s]+\gamma_z(\hat{z}_s-\mathbb{E}[\hat{z}_s])\right)}{\sigma'''_{\mathrm{cut},m}}\right)\Phi\left(\frac{z_{\mathrm{cut}}-\hat{z}_s}{\sigma_{\mathrm{cut},z}}\right)N(\hat{z}_s\mid\mathbb{E}[\hat{z}_s],\operatorname{Var}[\hat{z}_s])\,\mathrm{d}\hat{z}_s\\
&=\operatorname{BVN}\left(h=\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid E_s]+a_{\mathrm{cut},m}\mathbb{E}[\hat{x}_s]+b_{\mathrm{cut},m}\mathbb{E}[\hat{c}_s\mid E_s]\right)}{\sqrt{\sigma'''_{\mathrm{cut},m}^{2}+\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]^{2}}{\operatorname{Var}[\hat{z}_s]}}},\ k=\frac{z_{\mathrm{cut}}-\mathbb{E}[\hat{z}_s]}{\sqrt{\sigma_{\mathrm{cut},z}^{2}+\operatorname{Var}[\hat{z}_s]}},\ \rho=\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]}{\sqrt{\sigma'''_{\mathrm{cut},m}^{2}+\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]^{2}}{\operatorname{Var}[\hat{z}_s]}}\sqrt{\sigma_{\mathrm{cut},z}^{2}+\operatorname{Var}[\hat{z}_s]}}\right). \tag*{(65)}
\end{aligned}
where BVN is a cumulative bivariate normal distribution
BVN ( h , k ; ρ ) = ∫ − ∞ h ∫ − ∞ k 1 2 π 1 − ρ 2 exp ( − x 2 − 2 ρ x y + y 2 2 ( 1 − ρ 2 ) ) d y d x . (66) \operatorname{BVN}(h,k;\rho)=\int_{-\infty}^{h}\int_{-\infty}^{k}\frac{1}{2\pi\sqrt{1-\rho^{2}}}\exp\left(-\frac{x^{2}-2\rho xy+y^{2}}{2(1-\rho^{2})}\right)\,\mathrm{d}y\,\mathrm{d}x. \tag*{(66)} BVN ( h , k ; ρ ) = ∫ − ∞ h ∫ − ∞ k 2 π 1 − ρ 2 1 exp ( − 2 ( 1 − ρ 2 ) x 2 − 2 ρ x y + y 2 ) d y d x . (66)
Then finally we can solve for B \mathcal{B} B by integrating over E s E_s E s using integration by parts
B = ∫ 0 ∞ P ( I s = 1 ∣ μ s , z s , E s , Θ S N ) P ( E s ∣ τ ) d E s = ∫ 0 ∞ BVN ( h a + h b E s , k ; ρ ) 1 τ exp ( − E s / τ ) d E s = BVN ( h a , k ; ρ ) − exp ( 1 2 h b 2 τ 2 + h a h b τ ) BVN ( h a + 1 h b τ , k + ρ h b τ ; ρ ) . (67) \begin{aligned}
\mathcal{B}&=\int_{0}^{\infty}P(I_s=1\mid\mu_s,z_s,E_s,\boldsymbol{\Theta}_{\mathrm{SN}})P(E_s\mid\tau)\,\mathrm{d}E_s\\
&=\int_{0}^{\infty}\operatorname{BVN}(h_a+h_bE_s,k;\rho)\frac{1}{\tau}\exp(-E_s/\tau)\,\mathrm{d}E_s\\
&=\operatorname{BVN}(h_a,k;\rho)-\exp\left(\frac{1}{2h_b^{2}\tau^{2}}+\frac{h_a}{h_b\tau}\right)\operatorname{BVN}\left(h_a+\frac{1}{h_b\tau},k+\frac{\rho}{h_b\tau};\rho\right). \tag*{(67)}
\end{aligned} B = ∫ 0 ∞ P ( I s = 1 ∣ μ s , z s , E s , Θ SN ) P ( E s ∣ τ ) d E s = ∫ 0 ∞ BVN ( h a + h b E s , k ; ρ ) τ 1 exp ( − E s / τ ) d E s = BVN ( h a , k ; ρ ) − exp ( 2 h b 2 τ 2 1 + h b τ h a ) BVN ( h a + h b τ 1 , k + h b τ ρ ; ρ ) . (67)
where
h_a=\frac{m_{\mathrm{cut}}-\left(\mathbb{E}[\hat{m}_s\mid E_s=0]+a_{\mathrm{cut},m}\mathbb{E}[\hat{x}_s]+b_{\mathrm{cut},m}\mathbb{E}[\hat{c}_s\mid E_s=0]\right)}{\sqrt{\sigma'''_{\mathrm{cut},m}^{2}+\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]^{2}}{\operatorname{Var}[\hat{z}_s]}},\qquad
h_b=-\frac{R_B+b_{\mathrm{cut},m}}{\sqrt{\sigma'''_{\mathrm{cut},m}^{2}+\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]^{2}}{\operatorname{Var}[\hat{z}_s]}}},}
\rho=\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]}{\sqrt{\sigma'''_{\mathrm{cut},m}^{2}+\frac{\operatorname{Cov}[\hat{m}_s,\hat{z}_s]^{2}}{\operatorname{Var}[\hat{z}_s]}}\sqrt{\sigma_{\mathrm{cut},z}^{2}+\operatorname{Var}[\hat{z}_s]}},\qquad
k=\frac{z_{\mathrm{cut}}-\mathbb{E}[\hat{z}_s]}{\sqrt{\sigma_{\mathrm{cut},z}^{2}+\operatorname{Var}[\hat{z}_s]}}.
thus fully solving Eq. (58) for P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ S N ) P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\mu_s,z_s,\boldsymbol{\Theta}_{\mathrm{SN}}) P ( d ^ s , z ^ s ∣ I s = 1 , μ s , z s , Θ SN ) analytically. The solution to Eq. (58) is then used to calculate P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}) P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) where we numerically marginalise latent over z s z_s z s . The marginalised likelihood P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) P(\hat{\boldsymbol{d}}_s,\hat{z}_s\mid I_s=1,\boldsymbol{\Theta}) P ( d ^ s , z ^ s ∣ I s = 1 , Θ ) is used as an analytical baseline comparison in § 3.1 and also to give us perfect classification scores in § 3.3 .
tbl:C1 . Priors on the global parameters used in our experiments. Both the FlowSN2 and the analytical posteriors use the same priors. We denote a normal distribution truncated between [ a , b ] [a,b] [ a , b ] as N ( μ , σ 2 ) [ a , b ] \mathcal{N}(\mu,\sigma^2)_{[a,b]} N ( μ , σ 2 ) [ a , b ] . Some parameters are not varied in training and are kept at their fiducial values.
Simplified Forward Model Summary Fit Covariances
In our experiments, we draw realistic 3 × 3 3 \times3 3 × 3 light curve summary statistic fit covariance matrices Σ s ∼ P ( Σ ) \boldsymbol{\Sigma}_s \sim P(\boldsymbol{\Sigma}) Σ s ∼ P ( Σ ) for each simulated SN. We follow the empirical relations introduced by Boyd et al. (2026), which are motivated by observational covariance distributions in the Pantheon+ sample (Scolnic et al. 2022). The diagonal and off-diagonal elements are sampled according to
log Σ s m m ∼ N ( 0.2 ( m s − 56 ) , 1.2 2 ) log Σ s c c ∼ N ( − 7 , 0.6 2 ) log Σ s x x ∼ N ( − 3 , 1 2 ) Σ s m c ∼ N ( 5.2 × 10 − 4 + 0.289 Σ s m m , ( 0.126 Σ s m m ) 2 ) Σ s m x ∼ N ( 8.1 × 10 − 4 + 0.0384 Σ s x x , ( 0.0203 Σ s x x ) 2 ) Σ s c x ∼ N ( 1.69 × 10 − 4 + 0.0136 Σ s x x , ( 0.0118 Σ s x x ) 2 ) \begin{aligned}
\log\Sigma_s^{mm} &\sim\mathcal{N}\left(0.2(m_s-56),1.2^2\right) \\
\log\Sigma_s^{cc} &\sim\mathcal{N}\left(-7,0.6^2\right) \\
\log\Sigma_s^{xx} &\sim\mathcal{N}\left(-3,1^2\right) \\
\Sigma_s^{mc} &\sim\mathcal{N}\left(5.2 \times10^{-4}+0.289\Sigma_s^{mm},\left(0.126\Sigma_s^{mm}\right)^2\right) \\
\Sigma_s^{mx} &\sim\mathcal{N}\left(8.1 \times10^{-4}+0.0384\Sigma_s^{xx},\left(0.0203\Sigma_s^{xx}\right)^2\right) \\
\Sigma_s^{cx} &\sim\mathcal{N}\left(1.69 \times10^{-4}+0.0136\Sigma_s^{xx},\left(0.0118\Sigma_s^{xx}\right)^2\right)
\end{aligned} log Σ s mm log Σ s cc log Σ s xx Σ s m c Σ s m x Σ s c x ∼ N ( 0.2 ( m s − 56 ) , 1. 2 2 ) ∼ N ( − 7 , 0. 6 2 ) ∼ N ( − 3 , 1 2 ) ∼ N ( 5.2 × 1 0 − 4 + 0.289 Σ s mm , ( 0.126 Σ s mm ) 2 ) ∼ N ( 8.1 × 1 0 − 4 + 0.0384 Σ s xx , ( 0.0203 Σ s xx ) 2 ) ∼ N ( 1.69 × 1 0 − 4 + 0.0136 Σ s xx , ( 0.0118 Σ s xx ) 2 )
where we enforce a lower bound on the eigenvalues (λ min > 10 − 5 \lambda_{\min} > 10^{-5} λ m i n > 1 0 − 5 ) to guarantee that Σ s \boldsymbol{\Sigma}_s Σ s is strictly positive-definite. We apply this identical covariance distribution across both the training and test samples.
Global Parameter Priors and Training Ranges
In Table C1, we include the priors on our cosmological and SN population parameters used in inference. We also include the training distributions sampled per event when simulating the training set. Since our normalising flows are only conditioned (for q 1 ϕ 1 q_1^{\phi_1} q 1 ϕ 1 ) and evaluated (for q 2 ϕ 2 q_2^{\phi_2} q 2 ϕ 2 ) on latent redshift z s z_s z s and distance modulus μ s \mu_s μ s , there is no need to vary some of the top-level parameters during training. We instead add a Gaussian scatter of σ μ = 0.25 \sigma_\mu= 0.25 σ μ = 0.25 to latent distances pre-selection to provide support for different cosmological models on the Hubble diagram.
CMB and BAO Priors
For the experiments C 1 C_1 C 1 to C 3 C_3 C 3 that infer the w w w CDM model parameters we add a CMB prior for additional constraining power, whilst for experiments C 4 C_4 C 4 and C 5 C_5 C 5 we also include a BAO prior for constraining w 0 w a w_0w_a w 0 w a CDM.
CMB
To represent the constraints from the CMB we use a standard two-parameter compression (Komatsu et al. 2009). We define the ratio (or shift) parameter R R R and the acoustic scale ℓ A \ell_A ℓ A
R ( C ) = Ω m 0 H 0 d c ( z ∗ ; C ) c , ℓ A ( C ) = π d c ( z ∗ ; C ) r s ( z ∗ ; C ) , (68) R(C) = \frac{\sqrt{\Omega_{m0}}H_0d_c(z_*;C)}{c}, \qquad\ell_A(C) = \frac{\pi d_c(z_*;C)}{r_s(z_*;C)}, \tag*{(68)} R ( C ) = c Ω m 0 H 0 d c ( z ∗ ; C ) , ℓ A ( C ) = r s ( z ∗ ; C ) π d c ( z ∗ ; C ) , (68)
where d c d_c d c is the transverse co-moving distance function in Mpc and r s r_s r s is the co-moving sound horizon, both functions of C C C . We evaluate the functions at the redshift of recombination z ∗ z_* z ∗ which we obtain for each set of cosmological parameters using the Hu & Sugiyama (1996) approximation. In our calculations we assume constant physical baryon density ω b = 0.02237 \omega_b = 0.02237 ω b = 0.02237 , Hubble constant H 0 = 70 k m s − 1 M p c − 1 H_0 = 70\ \mathrm{km}\ \mathrm{s}^{-1}\ \mathrm{Mpc}^{-1} H 0 = 70 km s − 1 Mpc − 1 and speed of light c = 299792.458 k m s − 1 c = 299792.458\ \mathrm{km}\ \mathrm{s}^{-1} c = 299792.458 km s − 1 .
For each realisation we draw one correlated observation
\begin{pmatrix} \hat{R} \\ \hat{\ell}_A \end{pmatrix} \sim\mathcal{N}\left(\begin{pmatrix} R(C_{\mathrm{true}}) \\ \ell_A(C_{\mathrm{true}}) \end{pmatrix}, \Sigma_{\mathrm{CMB}}\right), \qquad\Sigma_{\mathrm{CMB}} = \begin{pmatrix} \sigma_R^2 & \rho\sigma_R\sigma_{\ell_A} \\ \rho\sigma_R\sigma_{\ell_A} & \sigma_{\ell_A}^2 \end{pmatrix}, \tag*{(69)}\end{pmatrix}
with the Planck 2018 distance prior precisions σ R = 0.0046 \sigma_R = 0.0046 σ R = 0.0046 , σ ℓ A = 0.09 \sigma_{\ell_A} = 0.09 σ ℓ A = 0.09 and ρ = 0.46 \rho= 0.46 ρ = 0.46 [104 ] .
BAO
We condense BAO observations into a 13 dimensional vector, using seven effective redshifts z 1 z_1 z 1 to z 7 z_7 z 7 between 0.295 and 2.33, such that
B ( C ) = ( d V ( z 1 ; C ) r d ( C ) , d c ( z 2 ; C ) r d ( C ) , d H ( z 2 ; C ) r d ( C ) , … , d c ( z 7 ; C ) r d ( C ) , d H ( z 7 ; C ) r d ( C ) ) T , (70) B(C) = \left(\frac{d_V(z_1;C)}{r_d(C)},\ \frac{d_c(z_2;C)}{r_d(C)},\ \frac{d_H(z_2;C)}{r_d(C)},\ \ldots,\ \frac{d_c(z_7;C)}{r_d(C)},\ \frac{d_H(z_7;C)}{r_d(C)}\right)^T, \tag*{(70)} B ( C ) = ( r d ( C ) d V ( z 1 ; C ) , r d ( C ) d c ( z 2 ; C ) , r d ( C ) d H ( z 2 ; C ) , … , r d ( C ) d c ( z 7 ; C ) , r d ( C ) d H ( z 7 ; C ) ) T , (70)
where d H d_H d H is the radial distance, d V d_V d V is the volume averaged distance and r d r_d r d is the co-moving sound horizon at the baryon drag epoch, evaluated with an approximation from Aubourg et al. (2015).
The observational covariance Σ B A O \Sigma_{\mathrm{BAO}} Σ BAO is defined to match DESI DR2 constraining power (Adame et al. 2025). We draw each BAO observation from a multivariate Gaussian centred at the true BAO observations
B ^ ∼ N ( B ( C t r u e ) , Σ B A O ) . (71) \hat{B} \sim\mathcal{N}(B(C_{\mathrm{true}}), \Sigma_{\mathrm{BAO}}). \tag*{(71)} B ^ ∼ N ( B ( C true ) , Σ BAO ) . (71)
Combined Posterior
With both CMB and BAO priors the posterior of Eq. (21) becomes
P ( Θ ∣ D ^ o b s , Z ^ o b s , I o b s , R ^ , ℓ ^ A , B ^ ) ∝ P ( D ^ o b s , Z ^ o b s ∣ I o b s , Θ ) P ( R ^ , ℓ ^ A ∣ C ) P ( B ^ ∣ C ) P ( Θ ∣ I o b s ) (72) P(\Theta\mid\hat{D}_{\mathrm{obs}}, \hat{Z}_{\mathrm{obs}}, I_{\mathrm{obs}}, \hat{R}, \hat{\ell}_A, \hat{B}) \propto P(\hat{D}_{\mathrm{obs}}, \hat{Z}_{\mathrm{obs}} \mid I_{\mathrm{obs}}, \Theta)P(\hat{R}, \hat{\ell}_A \mid C)P(\hat{B} \mid C)P(\Theta\mid I_{\mathrm{obs}}) \tag*{(72)} P ( Θ ∣ D ^ obs , Z ^ obs , I obs , R ^ , ℓ ^ A , B ^ ) ∝ P ( D ^ obs , Z ^ obs ∣ I obs , Θ ) P ( R ^ , ℓ ^ A ∣ C ) P ( B ^ ∣ C ) P ( Θ ∣ I obs ) (72)
where
P ( R ^ , ℓ ^ A ∣ C ) = N ( ( R ^ , ℓ ^ A ) T ∣ ( R ( C ) , ℓ A ( C ) ) T , Σ C M B ) and P ( B ^ ∣ C ) = N ( B ^ ∣ B ( C ) , Σ B A O ) . P(\hat{R}, \hat{\ell}_A \mid C) = \mathcal{N}\left((\hat{R}, \hat{\ell}_A)^T \mid(R(C), \ell_A(C))^T, \Sigma_{\mathrm{CMB}}\right) \quad\text{and} \quad P(\hat{B} \mid C) = \mathcal{N}(\hat{B} \mid B(C), \Sigma_{\mathrm{BAO}}). P ( R ^ , ℓ ^ A ∣ C ) = N ( ( R ^ , ℓ ^ A ) T ∣ ( R ( C ) , ℓ A ( C ) ) T , Σ CMB ) and P ( B ^ ∣ C ) = N ( B ^ ∣ B ( C ) , Σ BAO ) .
Further Investigation into Posterior Biases and Calibration
Here, we present additional experimental results. For the pure-Ia experiments described in § 3.1 , posterior averages over 25 realisations for cosmologies C 1 C_1 C 1 –C 3 C_3 C 3 are reported in Table E1 , comparing FlowSN2 against the analytical baseline. Table E2 presents the corresponding results for C 4 C_4 C 4 –C 5 C_5 C 5 , which incorporate CMB and BAO priors to constrain the w 0 w a w_0w_a w 0 w a CDM model parameters. In Figure E1 , we demonstrate the empirical calibration of our FlowSN2 posteriors for both pure-Ia samples (right column) and contaminated samples (left column).