  Energy companies need efficient procedures to perform market calibration of
stochastic models for commodities. If the Black framework is chosen for option
pricing, the bottleneck of the market calibration is the computation of the
variance of the asset. Energy commodities are commonly represented by
multi-factor linear models, whose variance obeys a matrix Lyapunov differential
equation. In this paper, analytical and numerical methods to derive the
variance are discussed: the Lyapunov approach is shown to be more
straightforward than ad-hoc derivations found in the literature and can be
readily extended to higher-dimensional models. A case study is presented, where
the variance of a two-factor mean-reverting model is embedded into the Black
formulae and the model parameters are calibrated against listed options. The
analytical and numerical method are compared, showing that the former makes the
calibration 14 times faster. A Python implementation of the proposed methods is
available as open-source software on GitHub.
