My own implementation of GMM estimator.