  This paper considers the problem of forecasting mortality rates. A large
number of models have already been proposed for this task, but they generally
have the disadvantage of either estimating the model in a two-step process,
possibly losing efficiency, or relying on methods that are cumbersome for the
practitioner to use. We instead propose using variational inference and the
probabilistic programming library Pyro for estimating the model. This allows
for flexibility in modelling assumptions while still being able to estimate the
full model in one step.
  The models are fitted on Swedish mortality data and we find that the
in-sample fit is good and that the forecasting performance is better than other
popular models.
  Code is available at https://github.com/LPAndersson/VImortality.
