Fast computation of some matrices useful in statistics
