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 eT A = eT, where e = (1,1,...,1)T, although A is not necessarily nonnegative) and A has the same first moment as T (i.e. e1T Ae1 = e1T Te1). We also explicitly find the closest matrix A to T when A is generalized doubly stochastic has the same first moment as T and the same second moment as T (i.e. e1T A²e1 = e1T T²e1), when such a matrix A exists.
doubly stochastic; generalized doubly stochastic; moments; nearest matrix; closest matrix; Frobenius norm