Let T be an arbitrary n × n matrix with real entries. We explicitly find the closest (in Frobenius norm) matrix A to T , where A is n × n with real entries, subject to the condition that A is “generalized doubly stochastic” (i.e. Ae = e and eA = e , where e = (1, 1, ..., 1) , although A is not necessarily nonnegative) and A has the same first moment as T (i.e. eT1 Ae1 = e T 1 Te1). We also expl...