<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Kilonova light-curve interpolation with neural networks</title></titleStmt>
			<publicationStmt>
				<publisher>American Physical Society / Physical Review</publisher>
				<date>07/01/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10542056</idno>
					<idno type="doi">10.1103/PhysRevResearch.6.033078</idno>
					<title level='j'>Physical Review Research</title>
<idno>2643-1564</idno>
<biblScope unit="volume">6</biblScope>
<biblScope unit="issue">3</biblScope>					

					<author>Yinglei Peng</author><author>Marko Ristić</author><author>Atul Kedia</author><author>Richard O'Shaughnessy</author><author>Christopher J Fontes</author><author>Chris L Fryer</author><author>Oleg Korobkin</author><author>Matthew R Mumpower</author><author>V Ashley Villar</author><author>Ryan T Wollaeger</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[<p>Kilonovae are the electromagnetic transients created by the radioactive decay of freshly synthesized elements in the environment surrounding a neutron star merger. To study the fundamental physics in these complex environments, kilonova modeling requires, in part, the use of radiative transfer simulations. The microphysics involved in these simulations results in high computational cost, prompting the use of emulators for parameter inference applications. Utilizing a training set of 22248 high-fidelity simulations (composed of 412 unique ejecta parameter combinations evaluated at 54 viewing angles), we use a neural network to efficiently train on existing radiative transfer simulations and predict light curves for new parameters in a fast and computationally efficient manner. Our neural network can generate millions of new light curves in under a minute. We discuss our emulator's degree of off-sample reliability and parameter inference of the AT2017gfo observational data. Finally, we discuss tension introduced by multiband inference in the parameter inference results, particularly with regard to the neural network's recovery of viewing angle.</p> <sec><title/><supplementary-material><permissions><copyright-statement>Published by the American Physical Society</copyright-statement><copyright-year>2024</copyright-year></permissions></supplementary-material></sec>]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>On August 18, 2017, prompt observations identified gravitational wave emission (GW170817; <ref type="bibr">[1,</ref><ref type="bibr">2]</ref>), shortly followed by a gamma-ray burst (short-GRB GRB170817A <ref type="bibr">[3]</ref>).</p><p>Extensive followup observations identified a long-duration optical/near-infrared counterpart, AT2017gfo, later identified as a "kilonova" <ref type="bibr">[4]</ref><ref type="bibr">[5]</ref><ref type="bibr">[6]</ref><ref type="bibr">[7]</ref><ref type="bibr">[8]</ref><ref type="bibr">[9]</ref><ref type="bibr">[10]</ref><ref type="bibr">[11]</ref><ref type="bibr">[12]</ref><ref type="bibr">[13]</ref><ref type="bibr">[14]</ref><ref type="bibr">[15]</ref><ref type="bibr">[16]</ref><ref type="bibr">[17]</ref><ref type="bibr">[18]</ref><ref type="bibr">[19]</ref><ref type="bibr">[20]</ref><ref type="bibr">[21]</ref>.</p><p>A kilonova <ref type="bibr">[22]</ref> is characterized by thermal emission from rapidly expanding, radioactively-powered, heavyelement material ejected from the associated progenitor merger. The detection of the joint gravitationaland electromagnetic-wave emission from GW170817 and AT2017gfo has initiated an era of precision kilonova observations.</p><p>Most interpretations of kilonova observations have relied on broadband photometry, in part owing to the relative sparsity of available spectra for AT2017gfo (and lack of spectral observations of other kilonovae; although see e.g. <ref type="bibr">[23]</ref><ref type="bibr">[24]</ref><ref type="bibr">[25]</ref>) <ref type="bibr">[26]</ref><ref type="bibr">[27]</ref><ref type="bibr">[28]</ref><ref type="bibr">[29]</ref><ref type="bibr">[30]</ref><ref type="bibr">[31]</ref><ref type="bibr">[32]</ref><ref type="bibr">[33]</ref><ref type="bibr">[34]</ref><ref type="bibr">[35]</ref><ref type="bibr">[36]</ref><ref type="bibr">[37]</ref><ref type="bibr">[38]</ref><ref type="bibr">[39]</ref><ref type="bibr">[40]</ref><ref type="bibr">[41]</ref><ref type="bibr">[42]</ref><ref type="bibr">[43]</ref>. A comprehensive review of kilonova broadband photometry has recently been compiled and presented in Ref. <ref type="bibr">[44]</ref>. Many studies interpreted their observations of AT2017gfo shortly after detection principally by comparison to simplified models for kilonovae <ref type="bibr">[4-10, 12, 14-21, 45, 46]</ref> consisting of one or more groups of non-accelerating (homologous) expanding material. Motivated both by binary merger simulations and the inability to fit observations with one component <ref type="bibr">[8]</ref>, at least two components are customarily employed <ref type="bibr">[10,</ref><ref type="bibr">12,</ref><ref type="bibr">[15]</ref><ref type="bibr">[16]</ref><ref type="bibr">[17]</ref><ref type="bibr">20]</ref>, with properties loosely associated with two expected features of merger simulations: promptly ejected material (the "dynamical" ejecta), associated with tidal tails or shocked material at contact; and material driven out on longer timescales by properties of the remnant system (the "wind" ejecta) <ref type="bibr">[47]</ref>.</p><p>Radiative transfer models of two-component kilonovae, whilst more physically accurate and informative, come with a significantly higher computational cost compared to semi-analytical or one-component models. As a result of this cost, many groups have resorted to surrogate models, or emulators, for the kilonova outflow, to reduce the computational impact associated with inference using these more complex models <ref type="bibr">[48]</ref><ref type="bibr">[49]</ref><ref type="bibr">[50]</ref><ref type="bibr">[51]</ref><ref type="bibr">[52]</ref><ref type="bibr">[53]</ref><ref type="bibr">[54]</ref><ref type="bibr">[55]</ref>.</p><p>In this paper, we use a neural network emulator for light-curve interpolation and parameter inference. We train on a previously-generated library of &#8764; 400 twocomponent kilonova light-curve simulations. Our method can be easily applied to any modestly-sized archive of adaptively-learned astrophysical transient light-curve simulations.</p><p>This paper is organized as follows. In Sec. II we discuss our simulation training library, the interpolation model and its architecture, and the associated light-curve interpolation methodology. In Sec. III we compare our emulator's performance with others employed in the literature and report inference results for observations of AT2017gfo. In Sec. IV, we summarize our findings. Our two-component kilonova model consists of a lanthanide-rich equatorial dynamical ejecta component and a lanthanide-poor axial wind ejecta component as described in <ref type="bibr">[56,</ref><ref type="bibr">57]</ref> and motivated by numerical simulations <ref type="bibr">[47,</ref><ref type="bibr">58]</ref>. Each component is homologously expanding and parameterized by a mass and velocity such that M d , v d and M w , v w describe the dynamical and wind components' masses and averaged velocities, respectively. The morphology for the dynamical component is an equatorially-centered torus, whereas the wind component is represented by an axially-centered peanut component; Figure <ref type="figure">1</ref> of <ref type="bibr">[56]</ref> displays the torus-peanut, or "TP," schematic corresponding to the morphologies employed in this work [see 57, for detailed definition]. The lanthanide-rich dynamical ejecta is a result of the r-process nucleosynthesis from a neutron-rich material with a low electron fraction (Y e &#8801; n p /(n p + n n )) of Y e = 0.04 with elements reaching the third r-process peak (A &#8764; 195), while the wind ejecta originates from higher Y e = 0.27 which encapsulates elements between the first (A &#8764; 80) and second (A &#8764; 130) r-process peaks. The detailed breakdown of the elements in each component can be found in Table <ref type="table">2</ref> of Ref. <ref type="bibr">[56]</ref>.</p><p>We use SuperNu <ref type="bibr">[59]</ref>, a Monte Carlo code for simulation of time-dependent radiation transport with matter in local thermodynamic equilibrium, to create simulated kilonova spectra F &#955;,sim assuming the aforementioned two-component model. Both components are assumed to have fixed composition and morphology for the duration of each simulation. SuperNu uses radioactive power sources calculated from decaying the r-process composition from the WinNet nuclear reaction network <ref type="bibr">[60]</ref><ref type="bibr">[61]</ref><ref type="bibr">[62]</ref><ref type="bibr">[63]</ref>. These radioactive heating contributions are also weighted by thermalization efficiencies introduced in Ref. <ref type="bibr">[64]</ref> (see Ref. <ref type="bibr">[65]</ref> for a detailed description of the adopted nuclear heating). We use detailed opacity calculations via the tabulated, binned opacities generated with the Los Alamos suite of atomic physics codes <ref type="bibr">[66]</ref><ref type="bibr">[67]</ref><ref type="bibr">[68]</ref>. In the database that we use, the tabulated, binned opacities are not calculated for all elements; therefore, we produce opacities for representative proxy elements by combining pure-element opacities of nuclei with similar atomic properties <ref type="bibr">[67]</ref>. Specifics of the representative elements for our composition are given in Ref. <ref type="bibr">[56]</ref>.</p><p>The SuperNu outputs are observing-angle-dependent, simulated spectra F &#955;,sim , post-processed to a source distance of 10 pc, in units of erg s -1 cm -2 &#197;-1 . The spectra are binned into 1024 equally log-spaced wavelength bins spanning 0.1 &#8804; &#955; &#8804; 12.8 microns.</p><p>For the purposes of this work, we consider the light curves for the 2MASS grizy and Rubin Observatory JHK broadband filters. As we only consider anisotropic simulations in this study, unless otherwise noted, we extract simulated light curves using 54 angular bins, uni-formly spaced in cos &#952; over the range -1 &#8804; cos &#952; &#8804; 1, where the angle &#952; is taken between the line of sight and the symmetry axis as defined in Equation <ref type="formula">2</ref>. Specifically, simulations in our database cover all observing angles with a resolution ranging from &#8710;&#952; = arcsin (2/54) &#8771; 2.1 &#8226; at the equator, to &#8710;&#952; = arccos (1 -2/54) &#8771; 15.6 &#8226; near the axes. This limiting angular resolution near the axes is comparable to the angles inferred from long-term radio observations of the gamma ray burst jet afterglow <ref type="bibr">[10,</ref><ref type="bibr">16,</ref><ref type="bibr">17,</ref><ref type="bibr">[69]</ref><ref type="bibr">[70]</ref><ref type="bibr">[71]</ref>.</p><p>SuperNu Monte Carlo radiative transport results have modest but nonzero Monte Carlo error. The impact of this Monte Carlo error can be estimated both by resolution studies as well as by simple smoothness diagnostics (e.g., versus angle and time). For example, in a previous study <ref type="bibr">[50]</ref> we performed Gaussian process interpolation over this same training set, inferring both an estimate of the light curve and a conservative estimate of its variance. The Monte Carlo error inherent in the underlying SuperNu simulations can be seen for example in Figure <ref type="figure">6</ref> of Ref. <ref type="bibr">[50]</ref> as short-angular-scale roughness on top of the overall smooth trend, with at most &#8764; 3% deviation at the 1&#963; level. Later, in Section III C, we describe a targeted resolution study. Based on these investigations, we expect that the statistical error of the underlying SuperNu simulations is smaller than the systematic errors introduced by interpolating between these simulations as described below.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Training Data Generation</head><p>Below we describe the approach taken to generate the simulation library in Ref. <ref type="bibr">[50]</ref>, hereafter R22. Our training library of 22248 kilonova light-curve simulations was constructed using iterative simulation placement guided by Gaussian process variance minimization. New simulations were placed with parameter combinations that were identified as having the largest bolometric luminosity variance by our Gaussian process regression approach. In other words, we placed new simulations in regions of parameter space where our bolometric luminosity interpolation root-mean-square uncertainty was largest. The Gaussian process variance s(&#8407; x) 2 is defined as</p><p>where &#8407; x is the vector of input parameters, &#8407; x a is the training data vector, the function k(&#8407; x, &#8407; x &#8242; ) is the kernel of the Gaussian process, and the indices a, a &#8242; are used to calculate the covariance between inputs &#8407; x and training data &#8407; x a , &#8407; x a &#8242; such that if a = a &#8242; , the variance is 0. In building the simulation library, we only considered the four-dimensional space of ejecta parameters</p><p>Each ejecta parameter combination yields simulations calculated for 54 equally-spaced viewing angles; as such, our training set of 22248 light curves corresponds to a core set of 412 unique ejecta parameter combinations.</p><p>For this work, we use the aforementioned light curves in the original simulation library as our training set. The light curves used in this work have the same parameters as those used for our light-curve interpolation approach in R22. No additional simulations were produced for the purposes of this work; all training data came from the simulation library presented in R22.</p><p>The original training data library consists of 22248 total light-curve simulations calculated at 264 times and 54 angular bins each. We do not perform any coordinate transformations, but rather interpolate directly in our ejecta parameter space and angle.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Data Processing</head><p>The entirety of our 22248 simulations is represented by a tensor, M abc , containing the AB magnitudes across the bands described in Section II A, which correspond to a set of input parameters &#8407; x. M abc has dimensions of 412&#215;264&#215;54, corresponding to 412 simulations evaluated at 264 log-spaced times between 0.125 and 37.24 days for 54 viewing angles equally spaced in cos &#952; for &#952; ranging from 0 to 180 &#8226; . We do not perform any normalization of our inputs or outputs, with ejecta parameters ranging from -3 &#8804; log m/M &#8857; &#8804; -1 and 0.05 &#8804; v/c &#8804; 0.3 and light-curves ranging from -18 to 8 AB magnitudes.</p><p>We split our four-dimensional ejecta parameter vector &#8407; x into training, validation, and test sets. We use 60% of the data for the training set, which contains information that the neural network uses to learn. Of the remaining 40%, 20% is used for the validation check, which tracks how well the network generalizes to off-sample inputs during training, and 20% goes into the test set, which is used to evaluate the network's predictions compared to known simulation data. Neither the validation set nor the test set data is used by the neural network for learning; therefore, we only use &#8764; 247 simulations for training, while the rest are used in various steps of verifying generalization (i.e. avoiding overfitting to the training data).</p><p>After splitting the data into training, validation, and test sets, we incorporate viewing angle as a fifth input parameter. As mentioned above, the viewing angles in our simulations are equally-spaced in cos &#952; space across 54 angular bins, as presented in the following equation:</p><p>Temporarily ignoring training, validation, or test sets, our training library consists of a total of 22248&#215;5 inputs, as illustrated in the following schematic matrix:</p><p>1 &#952; 3 . . . . . . . . . . . . . . . m d,1 v d,1 m w,1 v w,1 &#952; 54 m d,2 v d,2 m w,2 v w,2 &#952; 1 m d,2 v d,2 m w,2 v w,2 &#952; 2 . . . . . . . . . . . . . . . m d,412 v d,412 m w,412 v w,412 &#952; 54 &#63737; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63738; &#63739; D. Neural Network Architecture and Training</p><p>We use a standard feed-forward neural network called a multi-layer perceptron (MLP). Figure <ref type="figure">1</ref> shows our MLP architecture. The input data of dimension 5 (blue block) is propagated through the hidden layers of the MLP (pink blocks). These hidden layers apply a sequence of linear and non-linear transformations (black arrows) to progressively map the input to a higher-dimensional space. The network has six fully-connected layers (pink blocks) of dimension 128, 256, 64, 256, 128, and 264, respectively, which are followed by Rectified Linear Unit (ReLU) activation functions, except for the middle two layers. The final layer reduces the dimension to a 264 &#215; 1 vector, which matches the length of our light curves.</p><p>For each observing band, we train a separate neural network and compare its predictions with the simulation results. During training, the neural network's predictions for the inputs in the validation set are compared to the simulation data for those same inputs. The residual, or difference, between the two is evaluated by the mean squared error (MSE) loss function, which we use to measure the average squared difference between simulation data and the neural network prediction. We calculate the MSE according to</p><p>where y i is the corresponding simulation data at time i and &#375;i is the predicted value from the MLP model at the same time. We show the evolution of the training and validation losses in Figure <ref type="figure">2</ref> for the g-band network. We train a separate neural network for each of the broadband filters described in Section II A. Each network is trained for 1000 epochs, as this is enough time for the validation loss to convincingly stabilize at a floor value without beginning to increase, indicating overfitting. FIG. 1. A visual representation of the neural network architecture. The blue block represents our five-dimensional inputs &#8407; x &#952; . The pink blocks represent hidden layers, with labels under each block representing the input and output dimensions of each. Unlabeled right arrows indicate a linear mapping between layers, while those labeled "ReLU" have a Rectified Linear Unit activation function applied to their outputs. The orange block represents the neural network prediction in the form of a 264 &#215; 1 vector matching the length of our broadband light curves.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E. Neural Network Performance</head><p>in Figure <ref type="figure">3</ref> shows no indication of overfitting to the training data. For inference applications, our neural networks can generate the outcomes corresponding to five million five-dimensional inputs in about one minute. Training each neural network takes 20 minutes on a 2022-edition Macbook Pro with an M2 chip using the CPU. Since all the bands are independent and can be trained simultaneously in parallel, training all the emulators can be completed in this same 20 minute interval. Our training time is half the value reported in Ref. <ref type="bibr">[49]</ref>, though it is unclear whether their reported time assumes training in parallel or in serial. Training time of networks in parallel is expected to decrease appreciably on a highperformance computing cluster.</p><p>The top left plot in Figure <ref type="figure">3</ref> shows a histogram of the MSE values when evaluating the simulation library parameters using the neural network. We evaluate only the 412 unique ejecta parameter combinations, fixing the viewing angle to &#952; = 0 &#8226; in each case. In containing simulations from the training, validation, and test sets, this histogram represents the neural network's on-and offsample fidelity. The light-curve plots in Figure <ref type="figure">3</ref>  We note that, as with the emulators presented in Ref. <ref type="bibr">[50]</ref>, predictions for inputs with low-mass (log(M ) &#8764; -3) components or viewing angles &#952; &#8764; 90 &#8226; may deviate substantially from expectations. In Monte Carlo radiative transfer simulations of a kilonova, the representa- 5 1 2 4 8 16 32 64 t (days) 18 16 14 12 10 8 6 AB Mag g y r J i H z K 0.125 0.5 1 2 4 8 16 32 64 t (days) 16 14 12 10 8 6 4 AB Mag g y r J i H z K 0.125 0.5 1 2 4 8 16 32 64 t (days) 16 14 12 10 8 6 4 2 0 AB Mag g y r J i H z K FIG. 3. Top left: A histogram of MSE values, averaged across all bands by the number of observations, which characterize the deviation of the MLP's predictions from the true simulation library light curves. For simplicity, we assume a fixed viewing angle of &#952; = 0 &#8226; for each light curve and evaluate the MSE only for the 412 unique ejecta parameter combinations. Top right: True (points) and predicted (lines) light curves for a randomly drawn set of parameters with M SE &lt; 0.01. Bottom left: Same as top right, but for 0.01 &#8804; M SE &#8804; 0.1. Bottom right : Same as top right, but for M SE &gt; 0.1.</p><p>tion, a finite number of particles are employed to represent photons escaping from the system, forming "packets" of energy. The system's luminosity is intrinsically linked with, among other physical parameters, the ejecta mass. Consequently, when dealing with extremely lowmass components or viewing angles that look into the high-opacity dynamical ejecta, the simulations become particularly sensitive to Poisson noise due to reduced photon count. This effect, particularly with respect to low-mass ejecta, likely arises from our SuperNu simulations preferably sampling photon packets from higherenergy regions of the ejecta. In future studies, we hope to enhance the simulation interpretation under these conditions by way of an increase in photon packet count.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. BAYESIAN INFERENCES WITH THE NEURAL INTERPOLATOR A. Parameter Inference Methodology</head><p>As in R22, we infer the parameters of the kilonova AT2017gfo using our interpolated light curves and the AT2017gfo photometric data. The AT2017gfo data is originally presented in <ref type="bibr">[4-18, 20, 21]</ref>. We use the RIFT framework <ref type="bibr">[72]</ref> to adaptively perform the Monte Carlo integral and generate samples using a reduced &#967; 2 statistic. The parameter priors are the same as in R22, with uniform ejecta parameter priors of -3 &#8804; log m/M &#8857; &#8804; -1 and 0.05 &#8804; v/c &#8804; 0.3 and a Gaussian angle prior with &#181; = 20 and &#963; = 5 degrees. Unlike before, in this work we employ an adaptive volume Monte Carlo integrator, following closely the approach outlined in Ref. <ref type="bibr">[73]</ref>. The adaptive volume integrator allows for more efficient sam-pling given the higher-dimensional space being explored in this work.</p><p>Each sample &#8407; x &#952; is evaluated by the MLP to produce a light-curve prediction &#375; for every one of the grizy JHK broadband filters. We calculate the residual between the MLP prediction &#375; and the AT2017gfo observed data d for every band B by way of the reduced-&#967; 2 statistic</p><p>In our &#967; 2 residual calculation, we include observational uncertainties from the AT2017gfo data &#963; d , as well as systematic uncertainties &#963; sys which we use as a catch-all term to encompass all uncertainties, quantifiable or otherwise, associated with the neural network interpolation process. As outlined above and as discussed in greater quantitative detail in Section III C, we adopt a systematic modeling uncertainty, &#963; sys , of 0.5 magnitudes for our inference analysis.</p><p>For inference, we adopt a purely Gaussian likelihood based on these residuals</p><p>where N is the number of observations. As our inference is performed via adaptive Monte Carlo integration, the reliability of our posterior can be expressed in terms of a number of effective samples n eff . [Several different conventions exist for this number; see the appendix of <ref type="bibr">[74]</ref> for discussion.] For this study, we terminate our analyses when n eff &#8771; 10 3 . To validate our inference strategy, we constructed random synthetic sources, with kilonova model parameters drawn from our prior (albeit adopting a uniform rather than gaussian angular prior) and using observational times and uncertainties precisely matching the AT2017gfo cadence and instruments. For our synthetic sources, the expected light curve is generated using our neural network. As demonstrated with one example in Figure <ref type="figure">4</ref>, our inferences are always consistent with the injected kilonova parameters. To demonstrate that our implementation retains statistical purity, we also used 100 random synthetic sources to perform a conventional probability-probability (PP) test, available in an Appendix.</p><p>While we employ the fixed &#963; sys = 0.5 for most of our studies, in order to validate our results we also perform a few selected analyses with different choices, on the one hand adopting different discrete choices and on the other treating &#963; sys as a continuous unknown model parameter.</p><p>The analysis in Figure <ref type="figure">4</ref> demonstrates that, if the underlying model is correct, comparison with AT2017gfolike observations should very tightly constrain each of this model's parameters. This fiducial result thus has qualitatively different behavior than our and others' prior analyses of AT2017gfo, where posterior inferences arrive</p><p>logmd = 1.986 +0.028 0.027 0 .1 8 0 0 .1 9 5 0 .2 1 0 0 .2 2 5 0 .2 4 0 vd [c] vd = 0.210 +0.006 0.007 1 .9 5 1 .9 0 1 .8 5 1 .8 0 logmw [M ] logmw = 1.865 +0.018 0.024 0 .1 3 0 0 .1 3 5 0 .1 4 0 0 .1 4 5 0 .1 5 0 vw [c] vw = 0.141 +0.002 0.002 2 .1 6 2 .1 0 2 .0 4 1 .9 8 1 .9 2 logmd [M ] 8 4 8 7 9 0 9 3 9 6 [deg] 0 .1 8 0 0 .1 9 5 0 .2 1 0 0 .2 2 5 0 .2 4 0 vd [c] 1 .9 5 1 .9 0 1 .8 5 1 .8 0 logmw [M ] 0 .1 3 0 0 .1 3 5 0 .1 4 0 0 .1 4 5 0 .1 5 0 vw [c] 8 4 8 7 9 0 9 3 9 6 [deg] = 87.528 +1.868 1.389</p><p>FIG. <ref type="figure">4</ref>. Posteriors derived from a single randomly-generated synthetic kilonova source are consistent with its assumed model parameters. For this analysis, we have adopted the "zero noise" realization, where the kilonova light curve is precisely equal to its expected value.</p><p>at much broader posterior intervals, as discussed below. That said, the posterior shown above is consistent with the standard Fisher matrix estimate of the inverse covariance matrix &#915; = &#931; -1 , derived for example by taking (the expected value over noise realizations of) a secondorder Taylor series expansion of the log-likelihood as ln L = ln L o -2 -1 &#915; ab (x -x * ) a (x -x * ) b where x * are the true synthetic parameters:</p><p>In this expression, only first-order derivatives appear because we assume that the model has no systematic bias such that &#10216;d&#10217; = &#375;; however, this simple estimate also arises inevitably using the large-amplitude "linear signal approximation" <ref type="bibr">[75]</ref>. This Fisher matrix can be estimated to order of magnitude by replacing the derivatives &#8706; &#375;B /&#8706;x a by the ratio &#8710;y B /&#8710;x a , which for the mass parameters we approximate as 2/2 = 1, so the Fisher matrix is approximately &#915; &#8771; N/&#963; 2 sys and the posterior in each mass hyperparameter should have a one-standarddeviation scale of order 1/ &#8730; &#915; &#8771; &#963; sys / &#8730; N &#8771; 0.5/ &#8730; 333 &#8771; 0.027.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. AT2017gfo Parameter Inference</head><p>The posterior distributions for our input parameters &#8407; x &#952; are plotted in Figure <ref type="figure">5</ref>. The black posteriors represent 0.125 0.5 1 2 4 8 16 32 64 t (days) 17.5 20.0 22.5 25.0 27.5 30.0 AB Mag g + 7 y + 3 r + 6 J + 2 i + 5 H + 1 z + 4 K + 0 FIG. 6. Light curves generated by the MLP for the median parameters presented in Figure 5 (lines with shaded regions) with AT2017gfo observational data overplotted (scatter points). Despite the different values recovered between this analysis and that of R22, especially for the wind ejecta parameters and &#952;, the MLP prediction is able to replicate the observations surprisingly well.</p><p>the parameters identified in this study. As a direct comparison to the results of R22, we overplot the posterior distributions from that study in red. Despite using the same training data and comparing to the same observational data, the Gaussian process emulator and the MLP emulator recover posterior distributions with substan-tially different median values and distribution widths.</p><p>The dynamical ejecta parameters log m d and v d are similar between the two emulators, but the wind ejecta parameters log m w and v d , as well as the viewing angle &#952;, are quite different, with two of the three parameters inferred by the MLP residing outside of the GP inference 1&#963; limits. We verify the fidelity of the MLP inference results by generating light curves corresponding to the parameter values identified at the top of each column in Figure <ref type="figure">5</ref>. These light curves are shown in Figure <ref type="figure">6</ref> and indicate that, assuming a 0.5 magnitude systematic uncertainty, the inferred MLP parameters do indeed replicate the AT2017gfo data to a reasonable degree of accuracy. While the majority of data is well replicated, the earlytime g and r bands and the late-time J and H bands deviate slightly outside of our uncertainty bands.</p><p>The recovery of &#952; &#8776; 6 &#8226; is surprising for several reasons. First, the recovered angle was modestly offset from the Gaussian adopted as our inclination prior. Although different studies find a variety of viewing angles associated with AT2017gfo <ref type="bibr">[10,</ref><ref type="bibr">16,</ref><ref type="bibr">17,</ref><ref type="bibr">[69]</ref><ref type="bibr">[70]</ref><ref type="bibr">[71]</ref><ref type="bibr">76]</ref>, none indicate that the viewing angle is as low as our inference suggests. Second, and more importantly, for angular binning described by Equation <ref type="formula">2</ref>, the first angular bin encompasses all emitted photons for viewing angles &#8764; 0 -16 &#8226; . Therefore, by recovering a narrowly-peaked posterior around &#952; &#8776; 6 &#8226; , the MLP seems to indicate that it can identify angular variations within a single angular bin at a resolution much finer than what is provided by training data. In other words, these inference results are either overly constrained, or the MLP is able to identify fine angular variations in the light curves when trained on radiative transfer simulations using a coarser angular grid.</p><p>One conceivable explanation for the narrow posterior distribution seen in Figure <ref type="figure">5</ref> is an underestimate of the underlying systematic error. To investigate this possibility, Figure <ref type="figure">7</ref> shows the results of inferences performed when adopting dfferent choices for the white-noise systematic error parameter &#963; sys , adopting both discrete and continuously-distributed choices for this parameter. In all scenarios, we infer similar parameters for AT2017gfo, even though we allow for several magnitudes of potential systematic uncertainty. Conversely, this direct comparison between our models and the data directly infers a value for our systematic uncertainty parameter consistent with our fiducial choice.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Investigating MLP Predictions Near Inferred AT2017gfo Parameters</head><p>The extremely narrow posterior distribution in kilonova parameters and angle motivates a focused investigation of our training simulations and MLP model in the neighborhood of that posterior. As a first step, we performed followup SuperNu simulations at the inferred parameters using a higher angular resolution. Specifi-</p><p>logmd = 1.711 +0.130 0.136 0 .0 6 0 .1 2 0 .1 8 0 .2 4 0 .3 0 vd [c] vd = 0.132 +0.017 0.014 2 .2 2 .0 1 .8 1 .6 1 .4 logmw [M ] logmw = 1.690 +0.062 0.069 0 .0 8 0 .1 2 0 .1 6 0 .2 0 vw [c] vw = 0.095</p><p>+0.009 0.008 2 .8 2 .4 2 .0 1 .6 1 .2 logmd [M ] 8 1 6 2 4 3 2 [deg] 0 .0 6 0 .1 2 0 .1 8 0 .2 4 0 .3 0 vd [c] 2 .2 2 .0 1 .8 1 .6 1 .4 logmw [M ] 0 .0 8 0 .1 2 0 .1 6 0 .2 0 vw [c] cally, we increased the resolution by a factor of four to get a total of 216 angular bins. By reducing the number of photon packets in each angular bin by a factor of four, we also increase statistical noise by a factor of two. To ensure that our finer angular resolution analysis is not affected by this increase in statistical noise, we compare three separate simulations in Figure <ref type="figure">8</ref>. The</p><p>8 10 12 14 16 M AB, y 54 n 1/4 216 0.125 0.5 1 2 4 8 16 32 64 Time (days) 0.1 0.0 0.1 M AB, y n 1/4 54 216 54</p><p>FIG. <ref type="figure">8</ref>. Plots of SuperNu y-band light curves for a simulation like the ones described in Section II A (&#952;54), a simulation like &#952;54, but with one-quarter as many photon packets (n 1/4 ), and a simulation like &#952;54, but with four times greater angular resolution (&#952;216). The top panel indicates that, on a macroscopic scale, the simulations are identical. The bottom plot indicates that deviations do exist, likely attributed to statistical noise from the increase in angular bins, or matching reduction in packet count. The ejecta parameters used to create these simulations are those presented in Figure <ref type="figure">5</ref>.</p><p>blue curve, labeled &#952; 54 , shows a SuperNu simulation using the parameters from Figure <ref type="figure">5</ref>, hereafter x MLP and a standard 54-bin angular grid, as used in the training data simulations. The orange curve, labeled n 1/4 , shows a SuperNu simulation with the same exact parameters as &#952; 54 , except it uses one-quarter as many photon packets in the simulation. If the statistical noise described above were significant, the noise in n 1/4 should be much more pronounced than in &#952; 54 . Finally, the green curve, labeled &#952; 216 , shows a SuperNu simulation using the same parameters as &#952; 54 , but with a 216-bin angular grid, representing a factor of four increase in resolution. All three light curves show AB magnitude in the y-band as a function of time in days. As seen in Figure <ref type="figure">8</ref>, our followup simulations agree with one another, with small Monte Carlo error comparable to our initial estimate and small compared to our adopted systematic uncertainty (&#963; sys = 0.5).</p><p>We then compare our high angular resolution simulation &#952; 216 to the predictions of the MLP, computing the difference between model and prediction at all times and simulation angles. Figure <ref type="figure">9</ref> shows the residual &#8710;M AB in the y-band when we take the absolute difference between &#375;MLP and y sim , capped at a maximum difference of 1 magnitude. The residual values &#8710;M AB are initially evaluated for the 216 discrete angular bins; for visual clarity and diagnostic power, we linearly interpolate &#8710;M AB across time t and angle &#952; using the RegularGridInterpolator function from the scipy.interpolate library <ref type="bibr">[77]</ref>. Figure <ref type="figure">9</ref> exhibits both expected and unexpected behaviors. The large mismatch at early times when photon count is FIG. <ref type="figure">9</ref>. Deviations in y-band AB magnitude (&#8710;MAB) between a SuperNu simulation with four times the usual angular resolution (ysim) and the MLP prediction for the parameters reported in Figure <ref type="figure">5</ref> (yMLP) as a function of time t and angle &#952;. Notably, this comparison between our MLP (trained at low angular resolution) and the followup simulation (performed at high angular resolution) does not exhibit strong small-scale variation along the &#952; direction (i.e., between adjacent angular bins in the original training set and outside the original training resolution), suggesting that the MLP correctly interpolates to smaller angular scales. low, particularly as &#952; approaches 90 &#8226; where the higher opacity dynamical ejecta further reduces photon count, is to be expected. The MLP is not fitting the light curves in this region well as there are too few photons available in the training data. However, the low mismatch (i.e. good fitting) dark blue regions in the plot indicate some sort of structure in the MLP's underlying ability to reproduce light curves at different times and angles. While we only include the plot of &#8710;M AB for the y-band in Figure <ref type="figure">9</ref>, it is worth noting that the same behavior can be observed in these plots for all bands; predictable, low photon count systematics are identified in expected regions, but other, unexpected regions of increased systematic error manifest in different regions of the parameter space. Overall, however, the systematic uncertainties illustrated here are consistent with our expectations from the reported validation loss: a conservative systematic error of &#8730; M SE val &#8771; 0.5 reflects our overall uncertainty. For this reason, we adopted this systematic uncertainty in our parameter inferences above. This systematic uncertainty is substantially more conservative than the uncertainties adopted in R22.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Inference Using Broadband Data Subsets</head><p>The investigations in Section III C have introduced a surprise. On the one hand, our neural network reliably reproduces its training and validation data, including fol-lowup off-sample simulations performed at higher resolution. Though not shown here, we have also confirmed that the neural network agrees well with the surrogate provided in R22, using a small sample of randomlyselected ejecta parameters. On the other hand, the inferences obtained in Section III C by comparing all AT2017gfo kilonova observations to our MLP produce strikingly different results than R22. However, as noted in R22 and other works, most investigations have some tension between their models and the data, particularly in the bluer bands. In this section, motivated by this discrepancy, we also examine the effects on our AT2017gfo parameter inference when we use only specific subsets of the observational data. We perform two additional parameter inference runs using two categories of broadband data subsets: blue bands represented by the griz data and red bands represented by the yJHK data.</p><p>The posteriors in Figure <ref type="figure">10</ref> show how these bandlimited results compare with each other, the results of R22, and the all-band analysis presented in Section III C. The most apparent result is that the angle prior is recovered in both sets of posteriors, and both cases match the R22 results well. The other interesting feature is that the red yJHK posterior matches the R22 results much more closely than the blue posterior. Even when using a smaller subset of the observational data, the blue posteriors remain narrowly peaked in the parameter space, while the red posteriors become broader. The narrowness of the blue posteriors indicates that the blue broadband data determines the overall shape of the posteriors in the full broadband data inference.</p><p>The seemingly disproportionate effect of the blue broadband data on the posteriors could be attributed to the rapid evolution of the bluer bands compared to the red bands. As can be seen in Figure <ref type="figure">6</ref>, the evolution of the griz light curves is more rapid than the yJHK bands, with the griz light curves dimming by &#8764; 4 magnitudes compared to the yJHK bands dimming by two magnitudes during the first 10 days of observations. As such, the griz light curves will be more restrictive regarding which model parameters fit the data, which is evident from the Figure <ref type="figure">10</ref> posteriors.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E. Discussion</head><p>To summarize, following R22 we fit the same simulations and performed comparable inference of AT2017gfo. After assessing our training data and fit systematics, we adopted more conservative systematic uncertainties than R22. We nonetheless find dramatically narrower posteriors than R22, with inferred light curves consistent with observational predictions.</p><p>Several possible reasons for the qualitative discrepancies arise, primarily pertaining to our systematic uncertainty estimate. In R22, the Gaussian process interpolation provided a pointwise and parameter-dependent error estimate, which we qualitatively verified across the pa- rameter space. Also, the fitting strategy adopted in R22 independently fit each timestep. As a result, we expect that R22's models are unlikely to have correlated systematics in time, angle, and wavelength. For example, the R22 light curves occasionally have small but notable random discontinuities, consistent with their reported fitting uncertainty. By contrast, in this work, we fit all times and angles together within the same training set to generate a vector prediction. Our approach does not presently provide a pointwise error estimate. Therefore, for the method adopted in this work, we expect correlated errors in time and angle, but lack a method to characterize them versus those parameters or even the intrinsic kilonova parameters. Our MLP's vector lightcurve prediction necessitates fitting the entire light curve for a certain band given a single set of parameters. In addition, as mentioned in Section III D, the blue bands are particularly constraining due to their more significant evolution over the observation period. Combining both of these effects results in only an extremely narrow region of the parameter space fitting all broadband data consistently. We did not encounter such narrow posteriors in R22 as each prediction was made for a specific time point; as such, many samples could reasonably fit an observation at any given time, resulting in broader posteriors when all times were stitched together to form the light curve.</p><p>We use the validation loss value to roughly estimate the systematic fitting error associated with our neural network outcomes: the validation curve in Figure <ref type="figure">2</ref> suggests that differences of order &#8730; M SE &#8771; &#8730; 0.2 magnitudes should occur in our predictions. In practice, as illustrated in Figure <ref type="figure">7</ref> below, we find that the average squared systematic error suggests a larger value than the validation MSE. We therefore anticipate that our naive estimate of &#963; sys = 0.5, though well motivated by our detailed followup study, may still understate the systematic uncertainty inherent in our fitting approach, resulting in narrow posterior distributions. We also emphasize that the differences are not simply a matter of scale: the investigations performed in Figure <ref type="figure">7</ref> suggest that larger white-noise systematic error cannot reconcile differences between our current analysis and previous results.</p><p>We note that we have experienced similar systematic uncertainty associated with observations in blue bands in R22 and an associated inference using simulations of spectra <ref type="bibr">[54]</ref>. The systematics in those works were related to our inability to reproduce the observed blue flux at times past &#8764; 2 days using our best-fit simulations. The systematics in this work, though similar in their connection to blue observations, introduce slightly different effects in our resultant inference. As we solve the bigger problem of matching our simulations to late-time blue observations, we anticipate that a more sophisticated treatment of our emulator systematics will allow us to better understand the effects of blue-band data on our inferences.</p><p>A thorough investigation of suitable fit systematics for this neural network is well beyond the scope of our study. In the meantime, the neural network is suitable for investigations such as the one presented in Figure <ref type="figure">10</ref>, where we can examine our models' ability to fit certain subsets of the data. In the griz case, we see that our models require over 0.1 M &#8857; of slow-moving dynamical ejecta to fit the blue data. But, we expect dynamical ejecta to be less massive and faster, thus potentially suggesting a missing modeling component.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. CONCLUSIONS</head><p>We present a neural network architecture that is useful for the interpolation of kilonova light curves. We report on the network's training and validation loss as a metric of successful training, as well as present examples of off-sample light-curve recovery. We use the neural network to infer the parameters of the AT2017gfo kilonova and compare to previous inference performed in Ref. <ref type="bibr">[50]</ref>. We find that the inference results are quite different from those previously obtained, but the light curves generated by the recovered parameters align well with the observational data. In particular, we investigate the neural network's ability to seemingly infer narrow regions of the angle space despite being trained on light-curve data that should not allow for such specific inference. Given a detailed analysis of the mismatch between the neu-ral network's predictions and a simulation with higherresolution angular data, we find that the network's pointwise systematic errors are consistent with our error estimate. However, our investigations also suggest that the systematic errors are correlated, not independent, in time and angle, in a way that is not captured by our model for systematic uncertainties. In other words, we have discovered that the neural network's goodness-offit varies appreciably across the time-angle space. While some of these variations are expected, others form interesting features that we cannot readily explain. We leave the analysis of the interpretability of these features for a future investigation.</p><p>We also show that the systematic uncertainty may be more complex than assumed in our simple uncorrelated (white noise) error model. This was not the case in R22 due to the interpolation uncertainty, which naturally stemmed from the Gaussian process methodology. In recovering different parameters for AT2017gfo using two emulators trained on the same library of simulations, we highlight the importance of quantifiable uncertainty analysis in using emulators for robust inference. As we do not present a way to handle correlated uncertainties in this work, a detailed uncertainty analysis, along with the resultant effects on parameter inference, will be necessary in future work. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>89233218CNA000001).</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Appendix A: Validating inference method</head><p>To validate the statistical purity of our brute-force inference technique and our understanding of the noise model, we constructed a standard probability-probability (PP) plot test <ref type="bibr">[78,</ref><ref type="bibr">79]</ref>. Our description follows the notation and narrative used in <ref type="bibr">[74]</ref>. For each source k, with true parameters &#955; k , we calculate the fraction of its posterior distribution with parameter &#955; &#945; below the true source value &#955; k,&#945; [ Pk,&#945; (&lt; &#955; k,&#945; )]. After reindexing the sources so that Pk,&#945; (&#955; k,&#945; ) increases with k for some fixed &#945;, a plot of k/N versus Pk (&#955; k,&#945; ) can be compared with the expected diagonal result (P (&lt; p) = p) and binomial uncertainty interval. Figure <ref type="figure">11</ref> shows the PP plot derived using kilonova light curves generated with our neural network interpolator. In these analyses, we adopt precisely the same observation cadence and uncertainties as AT2017gfo. As in our fiducial analysis of AT2017gfo, we adopt &#963; sys = 0.5. Each synthetic observation incorporates both observational and (white noise) systematic uncertainty, added in quadrature consistent with our assumed likelihood.</p><p>The PP plot in Figure <ref type="figure">11</ref>, being sufficiently consistent with the binomial credible interval, suggests that the brute-force Monte Carlo inference strategy adopted in this work suffices for our purposes: in short, that the qualitative extent and character of the posteriors shown in our figures are reasonably correct, such that the considerable tension between our analysis and previous inferences accurately reflects the posterior. We have specifically chosen to present results from a brute-force inference technique to circumvent debates about our choice of implementation or our method of assessing convergence. With AT2017gfo, we have confirmed that the choice of integrator also doesn't qualitatively change our answer: alternative brute-force Monte Carlo integrator implementations produce similar results. That said, the PP plot above is clearly not as diagonal as would expected for a well-developed and calibrated Bayesian inference algorithm applied to this problem: its S-shape features suggests either modest overdispersion in our synthetic error model or modest underdispersion in our posterior distributions. </p></div></body>
		</text>
</TEI>
