In models of the dynamics of sexually transmitted diseases between and within N interacting populations, it is necessary to specify the matrix of contacts between populations. Mixing matrices have to satisfy a consistency condition that generally will not be satisfied by empirically obtained matrices. The problem of inferring a mixing matrix from data is phrased here as the problem of finding a matrix in a prescribed set that minimizes an opportune distance from the matrix of data. Two different distances that attempt to measure relative errors are suggested. When no constraints are posed on the activity rates of the populations, the author shows that the minimum distance from data is attained at Knox's (1986) matrix. When activity rates are to be preserved, the minimum cannot be found explicitly for N > 2. An algorithm proposed by Arcá, Perucei, Spadea, and Rossi (1990) is then investigated, and shown always to converge to a consistent matrix. Through several examples, it is shown that this limiting matrix does not minimize distance from data, but is generally close to the minimum. Finally, the author simulated the collection of data with sampling errors and possible bias and evaluated the performance of this algorithm in approximating the ‘true’ contact matrix starting from the simulated ‘data’ matrix.