  Type Ia supernovae (SNe Ia) are standarizable candles whose observed light
curves can be used to infer their distances, which can in turn be used in
cosmological analyses. As the quantity of observed SNe Ia grows with current
and upcoming surveys, increasingly scalable analyses are necessary to take full
advantage of these new datasets for precise estimation of cosmological
parameters. Bayesian inference methods enable fitting SN Ia light curves with
robust uncertainty quantification, but traditional posterior sampling using
Markov Chain Monte Carlo (MCMC) is computationally expensive. We present an
implementation of variational inference (VI) to accelerate the fitting of SN Ia
light curves using the BayeSN hierarchical Bayesian model for time-varying SN
Ia spectral energy distributions (SEDs). We demonstrate and evaluate its
performance on both simulated light curves and data from the Foundation
Supernova Survey with two different forms of surrogate posterior -- a
multivariate normal and a custom multivariate zero-lower-truncated normal
distribution -- and compare them with the Laplace Approximation and full MCMC
analysis. To validate of our variational approximation, we calculate the
pareto-smoothed importance sampling (PSIS) diagnostic, and perform variational
simulation-based calibration (VSBC). The VI approximation achieves similar
results to MCMC but with an order-of-magnitude speedup for the inference of the
photometric distance moduli. Overall, we show that VI is a promising method for
scalable parameter inference that enables analysis of larger datasets for
precision cosmology.
