Closed cromer043 closed 1 year ago
Hello,
My understanding is that optim()
does not provide this, so wieghtit()
cannot either if this is so. It looks like you can do this with the ebal
package, which was also written by Hainmueller. You can use cobalt::get.w()
to extract the weights from the ebalance()
function and WeightIt::as_weightit()
to get back to a weightit
object if you want.
For fine control over how much imbalance is allowed, check out my optweight
package, which performs an optimization similar to entropy balancing.
Using entropy balancing, method = ebal, when sample sizes are relatively small, entropy balancing will fail. In order to handle this, the convergence tolerance level in optim()needs to be raised up from sqrt(.Machine$double.eps). The reltol can be adjusted but it’s unclear what it can/should be adjusted to. The process should grab the last reltol value from optim(), then make it available to pass it to WeightIt() to get weights at a higher tolerance level. In Stata, the ebalance package returns the tolerance level after each run. See example below. Is it possible to similarly include the last reltol in W1$obj?