Analytical Models#
Fiesta includes a library of analytical (physics-based) light-curve models implemented in pure JAX. Unlike the surrogate models, which are neural-network approximations trained on simulation data, analytical models evaluate closed-form or ODE-based physics equations directly.
Key properties:
JIT-compilable and differentiable – compatible with flowMC’s MALA gradient sampler via
jax.grad.Drop-in replacements for surrogates – every analytical model exposes the same
predict()interface and can be used insideCombinedSurrogateandEMLikelihoodwithout any code changes.Float32-safe – all internal computations use log10 space to avoid overflow (e.g. explosion energies ~1e49 erg exceed float32 max ~3.4e38).
When to use analytical models vs surrogates:
Use surrogates when a fast, pre-trained approximation of a complex simulation (e.g. radiative-transfer kilonova or jet afterglow) is available and sufficient.
Use analytical models when you need direct physics interpretability, want to combine a surrogate with a simple analytical component (e.g. afterglow surrogate + kilonova analytical), or when no surrogate exists for the transient class of interest.
Usage#
Instantiating a model
Every analytical model takes a list of filter names and an array of source-frame times (days):
import jax.numpy as jnp
from fiesta.inference.analytical_models import OneComponentKilonovaModel
model = OneComponentKilonovaModel(
filters=["bessellb", "bessellv", "bessellr"],
times=jnp.geomspace(0.1, 30.0, 100),
)
Calling predict
The predict method accepts a dictionary of parameter values and returns
(source_frame_times, {filter_name: apparent_mag_array}):
params = {
"log10_mej": -1.5,
"log10_vej": -0.5,
"log10_kappa": -0.3,
"luminosity_distance": 100.0, # Mpc
"redshift": 0.022,
}
t_days, mag_app = model.predict(params)
# mag_app["bessellb"] is an array of apparent magnitudes
Combining with a surrogate
Analytical models are interchangeable with surrogates inside
CombinedSurrogate. For example, to model a kilonova + GRB afterglow
where the afterglow is a trained surrogate:
from fiesta.inference.lightcurve_model import AfterglowFlux, CombinedSurrogate
from fiesta.inference.analytical_models import OneComponentKilonovaModel
afterglow = AfterglowFlux(
name="afgpy_gaussian_CVAE",
filters=["bessellb", "bessellv", "bessellr"],
)
kilonova = OneComponentKilonovaModel(
filters=["bessellb", "bessellv", "bessellr"],
times=jnp.geomspace(0.1, 30.0, 100),
)
combined = CombinedSurrogate(
models=[afterglow, kilonova],
sample_times=jnp.geomspace(0.1, 300.0, 200),
)
t, mags = combined.predict(params)
The fluxes of both models are added in each photometric band. If a model
falls outside the time range of the sample_times it is set to
jnp.inf mag there.
Model Catalogue#
Phenomenological Models#
Empirical shape functions that parameterize light-curve morphology directly in magnitudes, without underlying radiation physics.
BazinModel
Exponential rise and fall (Bazin et al. 2009). Useful as a generic empirical template for any transient.
Parameter |
Description |
Units |
|---|---|---|
|
Explosion / reference time |
days |
|
Rise timescale (log10) |
log10(days) |
|
Fall timescale (log10) |
log10(days) |
|
Peak amplitude per filter f |
mag |
|
Baseline flux per filter f |
mag |
VillarModel
Piecewise linear rise + power-law decay with a smooth sigmoid transition (Villar et al. 2017).
Parameter |
Description |
Units |
|---|---|---|
|
Explosion / reference time |
days |
|
Rise timescale (log10) |
log10(days) |
|
Fall timescale (log10) |
log10(days) |
|
Power-law decay slope before peak |
– |
|
Transition point (log10) |
log10(days) |
|
Amplitude per filter f |
mag |
AfterglowModel
Smooth broken power-law for GRB/jet afterglow light curves.
Parameter |
Description |
Units |
|---|---|---|
|
Reference time |
days |
|
Break time (log10) |
log10(days) |
|
Pre-break power-law index |
– |
|
Post-break power-law index |
– |
|
Amplitude per filter f |
mag |
PhenomenologicalTDEModel
Sigmoid rise + power-law decay for tidal disruption events.
Parameter |
Description |
Units |
|---|---|---|
|
Explosion / reference time |
days |
|
Rise timescale (log10) |
log10(days) |
|
Fall timescale (log10) |
log10(days) |
|
Power-law decay index |
– |
|
Amplitude per filter f |
mag |
|
Baseline flux per filter f |
mag |
EvolvingBlackbodyModel
Empirical piecewise power-law evolution of temperature and radius, converted
to broadband magnitudes via blackbody SED. Unlike the other phenomenological
models this computes bolometric luminosity from L = 4 pi R^2 sigma T^4.
Parameter |
Description |
Units |
|---|---|---|
|
Initial temperature (log10) |
log10(K) |
|
Initial radius (log10) |
log10(cm) |
|
Temperature power-law index before peak |
– |
|
Temperature power-law index after peak |
– |
|
Time of temperature maximum |
days |
|
Radius power-law index before peak |
– |
|
Radius power-law index after peak |
– |
|
Time of radius maximum |
days |
Supernova Models#
Models for core-collapse and thermonuclear supernovae powered by radioactive decay, magnetar spin-down, or circumstellar interaction.
ArnettModel
Nickel-56 / Cobalt-56 radioactive decay without diffusion (Arnett 1982). Uses Gauss-Legendre quadrature for the decay integral.
Parameter |
Description |
Units |
|---|---|---|
|
Diffusion timescale |
days |
|
Nickel-56 mass (log10) |
log10(Msun) |
|
Photospheric velocity |
1e9 cm/s |
NickelCobaltModel
Nickel-56 / Cobalt-56 decay with Arnett (1982) diffusion integral.
Parameter |
Description |
Units |
|---|---|---|
|
Fraction of ejecta in Nickel-56 |
– |
|
Ejecta mass (log10) |
log10(Msun) |
|
Ejecta velocity (log10) |
log10(km/s) |
|
Optical opacity (log10) |
log10(cm^2/g) |
|
Gamma-ray opacity (log10) |
log10(cm^2/g) |
MagnetarPoweredSNModel
Magnetar spin-down engine with Arnett diffusion.
Parameter |
Description |
Units |
|---|---|---|
|
Initial spin period (log10) |
log10(ms) |
|
Polar magnetic field (log10, in units of 1e14 G) |
log10(1e14 G) |
|
Neutron star mass |
Msun |
|
Angle between spin and B-field axes |
radians |
|
Ejecta mass (log10) |
log10(Msun) |
|
Ejecta velocity (log10) |
log10(km/s) |
|
Optical opacity (log10) |
log10(cm^2/g) |
|
Gamma-ray opacity (log10) |
log10(cm^2/g) |
CSMInteractionModel
Circumstellar medium shock interaction following the Chevalier (1982) self-similar solution for forward and reverse shocks.
Parameter |
Description |
Units |
|---|---|---|
|
Ejecta mass (log10) |
log10(Msun) |
|
CSM mass (log10) |
log10(Msun) |
|
Ejecta velocity (log10) |
log10(km/s) |
|
CSM density profile exponent |
– |
|
CSM density amplitude (log10) |
log10(g/cm^{eta+3}) |
|
Opacity (log10) |
log10(cm^2/g) |
|
CSM inner radius (log10) |
log10(AU) |
Kilonova Models#
Models for kilonovae (neutron-star merger ejecta) powered by r-process radioactive heating.
MetzgerModel
Multi-shell ODE kilonova with 300 mass shells (Metzger 2017). Includes early neutron precursor and late r-process heating.
Parameter |
Description |
Units |
|---|---|---|
|
Ejecta mass (log10) |
log10(Msun) |
|
Minimum ejecta velocity (log10) |
log10(c) |
|
Velocity power-law index |
– |
|
R-process opacity (log10) |
log10(cm^2/g) |
MetzgerFullModel
Multi-shell ODE kilonova with 200 shells using linear velocity spacing and Barnes+16 thermalisation efficiency.
Parameter |
Description |
Units |
|---|---|---|
|
Ejecta mass (log10) |
log10(Msun) |
|
Minimum ejecta velocity (log10) |
log10(c) |
|
Velocity power-law index |
– |
|
R-process opacity (log10) |
log10(cm^2/g) |
Constructor options: neutron_precursor (bool, default True),
vmax (float, default 0.7).
OneComponentKilonovaModel
Single-component kilonova using a diffusion integral (no ODE).
Parameter |
Description |
Units |
|---|---|---|
|
Ejecta mass (log10) |
log10(Msun) |
|
Ejecta velocity (log10) |
log10(c) |
|
Gray opacity (log10) |
log10(cm^2/g) |
Constructor options: temperature_floor (float, e.g. 4000.0 K).
MagnetarBoostedKilonovaModel
Multi-shell ODE kilonova (200 shells) with additional magnetar spin-down heating injected into the innermost shell.
Parameter |
Description |
Units |
|---|---|---|
|
Ejecta mass (log10) |
log10(Msun) |
|
Minimum ejecta velocity (log10) |
log10(c) |
|
Velocity power-law index |
– |
|
R-process opacity (log10) |
log10(cm^2/g) |
|
Initial spin period (log10) |
log10(ms) |
|
Polar magnetic field (log10, in units of 1e14 G) |
log10(1e14 G) |
|
Neutron star mass |
Msun |
|
Angle between spin and B-field axes |
radians |
|
Magnetar thermalisation fraction |
– |
Constructor options: neutron_precursor (bool), pair_cascade (bool),
vmax (float).
Shock-Powered Models#
Models for early emission powered by shock breakout and shock cooling.
ShockCoolingModel
Shock-cooling emission following Piro (2021) with analytic piecewise solution.
Parameter |
Description |
Units |
|---|---|---|
|
Envelope mass (log10) |
log10(Msun) |
|
Envelope radius (log10) |
log10(Rsun) |
|
Explosion energy (log10) |
log10(erg) |
ShockedCocoonModel
Jet cocoon shock cooling with a fully algebraic (closed-form) solution.
Parameter |
Description |
Units |
|---|---|---|
|
Ejecta mass (log10) |
log10(Msun) |
|
Ejecta velocity (log10) |
log10(c) |
|
Density profile exponent |
– |
|
Shock breakout time (log10) |
log10(s) |
|
Fraction of ejecta shocked |
– |
|
Cosine of cocoon opening angle |
– |
|
Gray opacity (log10) |
log10(cm^2/g) |
Other Models#
TDEAnalyticalModel
Tidal disruption event with t^{-5/3} fallback accretion rate and
Arnett-style diffusion.
Parameter |
Description |
Units |
|---|---|---|
|
Luminosity at 1 second (log10) |
log10(erg/s) |
|
Turn-on time |
days |
|
Ejecta mass (log10) |
log10(Msun) |
|
Ejecta velocity (log10) |
log10(km/s) |
|
Opacity (log10) |
log10(cm^2/g) |
|
Gamma-ray opacity (log10) |
log10(cm^2/g) |
SALT3Model
Type Ia supernova spectral-template model using the SALT3 SED framework.
Requires the jax-bandflux package (pip install jax-bandflux).
Parameter |
Description |
Units |
|---|---|---|
|
SALT3 amplitude (log10) |
– |
|
SALT3 stretch |
– |
|
SALT3 color |
– |
|
Time of B-band maximum (observer-frame) |
days |
Note
Unlike all other analytical models, SALT3Model expects times in
the observer frame, not the source frame.
Writing a Custom Model#
To add a new analytical model, subclass AnalyticalModel and implement
compute_log10_lbol_rphot:
import jax.numpy as jnp
from fiesta.inference.analytical_models import AnalyticalModel
class MyModel(AnalyticalModel):
parameter_names = ["log10_luminosity", "log10_radius"]
def __init__(self, filters, times=None):
super().__init__(filters=filters, times=times)
def compute_log10_lbol_rphot(self, x, t_days):
# Return (log10_Lbol [erg/s], log10_Rphot [cm]) at each t
log10_L = jnp.full_like(t_days, x["log10_luminosity"])
log10_R = jnp.full_like(t_days, x["log10_radius"])
return log10_L, log10_R
The base class handles the blackbody SED, filter integration, redshift
correction, and distance modulus automatically. The predict method
is JIT-compiled and differentiable out of the box.
For phenomenological models that parameterize magnitudes directly (rather
than bolometric luminosity), subclass PhenomenologicalModel instead
and implement compute_shape.