Open talgalili opened 9 months ago
This issue also happens for post stratification. The locations of the functions to fix:
https://github.com/facebookresearch/balance/blob/0081b51a39783cfb245e3077927c96fcf0b3ffb0/balance/weighting_methods/rake.py#L26 https://github.com/facebookresearch/balance/blob/0081b51a39783cfb245e3077927c96fcf0b3ffb0/balance/weighting_methods/poststratify.py#L20
We might need to add it here: https://github.com/facebookresearch/balance/blob/0081b51a39783cfb245e3077927c96fcf0b3ffb0/balance/weighting_methods/rake.py#L243
As opposed to how it's solved for, say, CBPS: https://github.com/facebookresearch/balance/blob/0081b51a39783cfb245e3077927c96fcf0b3ffb0/balance/weighting_methods/cbps.py#L676 And ipw https://github.com/facebookresearch/balance/blob/0081b51a39783cfb245e3077927c96fcf0b3ffb0/balance/weighting_methods/ipw.py#L178
Since there is always also the stage of normalizing the sum of weights of target population, it might be more easily solved as a new function that trims and normalize to sum of weights of the target.
This is violating user expectation.
E.g.:
By expectation violation I mean,
(Reported by David Lovis-McMahon)