cg-stats function

Mean, covariance and counts for grouped data (statistics for conditional Gaussian distribution).