closure function for estimator