Vectorized solution to estimate Gaussian parameters