I am having some trouble understanding what loss function is being minimized to ensure that we are converging towards the best set of weights in the Genmatch function in R. I was reading the paper on it and if I understand right, it seems to say somewhat contradictory things on the same page.

1) First it says that a generalized version of the mahalanobis distance is minimized. This doesn't make too much sense to be as this distance metric is only for measuring the distance between 2 subjects, and does not look at the overall balance between 2 populations. If it does minimize the average distance between the two populations, that is not stated in the paper, and does not seem to stated anywhere else either. Excerpt:

enter image description here

2) Then on the same page it is stated the overall balance is maximized using the p values from t-tests and KS tests. This one makes more sense to me. But I am not sure how the Mahalanobis distance mentioned earlier plays a part in this. Excerpt: enter image description here

If anyone knows what loss function is being used please let me know

Link for paper: https://www.mitpressjournals.org/doi/10.1162/REST_a_00318


The loss function is indeed the minimum p-value resulting from a set of balance tests on the matched sample. The sample is formed by performing matching. The distance metric used for matching is the GMD. The GMD incorporates a vector of weights (one for each covariate). These weights are the variables over which the optimization occurs.

Working forwards, the algorithm estimates a set of weights, computes the GMD for each pair of individuals using those weights, matches pairs of units with small GMDs, then perform the balance tests in the matched sample. The smallest p-value from these balance tests is the value of the loss function for that set of weights. Then, a new set of weights is tried, and the smallest p-value is assessed again. The result of the algorithm is a set of "optimal" weights, which you can then use to compute the GMD in your sample, perform matching on the GMD, and then estimate the treatment effect in the matched sample.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.