measure_mse function

Estimate mean squared error