  An interesting question in the field of martingale optimal transport, is to
determine the martingale with prescribed initial and terminal marginals which
is most correlated to Brownian motion. Under a necessary and sufficient
irreducibility condition, the answer to this question is given by a
$\textit{Bass martingale}$. At an intuitive level, the latter can be imagined
as an order-preserving and martingale-preserving space transformation of an
underlying Brownian motion starting with an initial law $\alpha$ which is tuned
to ensure the marginal constraints.
  In this article we study how to determine the aforementioned initial
condition $\alpha$. This is done by a careful study of what we dub the
$\textit{Bass functional}$. In our main result we show the equivalence between
the existence of minimizers of the Bass functional and the existence of a Bass
martingale with prescribed marginals. This complements the convex duality
approach in a companion paper by the present authors together with M.
Beiglb\"ock, with a purely variational perspective. We also establish an
infinitesimal version of this result, and furthermore prove the displacement
convexity of the Bass functional along certain generalized geodesics in the
$2$-Wasserstein space.
