  The Multilevel Monte Carlo (MLMC) method has been applied successfully in a
wide range of settings since its first introduction by Giles (2008). When using
only two levels, the method can be viewed as a kind of control-variate approach
to reduce variance, as earlier proposed by Kebaier (2005). We introduce a
generalization of the MLMC formulation by extending this control variate
approach to any number of levels and deriving a recursive formula for computing
the weights associated with the control variates and the optimal numbers of
samples at the various levels.
  We also show how the generalisation can also be applied to the
\emph{multi-index} MLMC method of Haji-Ali, Nobile, Tempone (2015), at the cost
of solving a $(2^d-1)$-dimensional minimisation problem at each node when $d$
index dimensions are used.
  The comparative performance of the weighted MLMC method is illustrated in a
range of numerical settings. While the addition of weights does not change the
\emph{asymptotic} complexity of the method, the results show that significant
efficiency improvements over the standard MLMC formulation are possible,
particularly when the coarse level approximations are poorly correlated.
