jkcshea / ivmte

An R package for implementing the method in Mogstad, Santos, and Torgovitsky (2018, Econometrica).
GNU General Public License v3.0
18 stars 2 forks source link

Misleading warning about suboptimal solution? #215

Closed johnnybonney closed 2 years ago

johnnybonney commented 2 years ago

(Apologies in advance for the lack of any MWE - I found it difficult to produce one for this behavior - hopefully it is all clear, though!)


I've had a few cases where running ivmte with noisy = F leads to the following warning:

Warning:  The solver was unable to satisfy the optimality tolerance for the maximization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'. 

When noisy = F, this is the only output on my screen. My gut reaction (influenced by the warning) would be to dive into some of Gurobi's options to figure out how I might get an optimal solution...

But, if I set noisy = T for the same problem, I get output like

Obtaining propensity scores...

Generating target moments...
    Integrating terms for control group...
    Integrating terms for treated group...

Performing direct MTR regression...
    MTR is not point identified.

Performing audit procedure...
    Solver: Gurobi ('gurobi')
    Generating initial constraint grid...

    Audit count: 1
    Minimum criterion: 0.09794235
    Obtaining bounds...
    Violations:  6 
    Expanding constraint grid to include 6 additional points...

    Audit count: 2
    Minimum criterion: 0.0983188
    Obtaining bounds...
Warning:  The solver was unable to satisfy the optimality tolerance for the maximization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'. 
    Violations:  4 
    Expanding constraint grid to include 4 additional points...

    Audit count: 3
    Minimum criterion: 0.09831879
    Obtaining bounds...
    Violations: 0
    Audit finished.

Bounds on the target parameter: [0.2935714, 0.8459505]

My understanding is that the solution for the second audit was suboptimal, but my ultimate solution (after the third audit) was optimal---in which case, I don't see a good reason to mess around with Gurobi's options.

I am just wondering if the warning should only be shown at all if the ultimate bounds themselves are optimal. It strikes me as unnecessarily concerning (but I may be missing something here).

jkcshea commented 2 years ago

Oh, that's a good suggestion. Okay, I will try to correct this!

a-torgovitsky commented 2 years ago

Yes good point @johnnybonney , all we care about is the final iteration of the audit. At the end of the day, the audit is just there to try to keep computation under control.

jkcshea commented 2 years ago

Okay, this is resolved. The check for optimal solutions is now only performed after the final audit.

Although I also couldn't generate a MWE, the following output (with multiple warnings) will no longer happen:

Obtaining propensity scores...

Generating target moments...
    Integrating terms for control group...
    Integrating terms for treated group...

Performing direct MTR regression...
    MTR is not point identified.

Performing audit procedure...
    Solver: Gurobi ('gurobi')
    Generating initial constraint grid...

    Audit count: 1
    Minimum criterion: 0.2343829
    Obtaining bounds...
Warning:  The solver was unable to satisfy the optimality tolerance for the minimization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'. 
    Violations:  363 
    Expanding constraint grid to include 157 additional points...

    Audit count: 2
    Minimum criterion: 0.2343921
    Obtaining bounds...
Warning:  The solver was unable to satisfy the optimality tolerance for the maximization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'. 
    Violations:  72 
    Expanding constraint grid to include 72 additional points...

    Audit count: 3
    Minimum criterion: 0.2343925
    Obtaining bounds...
Warning:  The solver was unable to satisfy the optimality tolerance for the minimization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'. 
    Violations:  62 
    Expanding constraint grid to include 62 additional points...

    Audit count: 4
    Minimum criterion: 0.2343925
    Obtaining bounds...
Warning:  The solver was unable to satisfy the optimality tolerance for the maximization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'. 
    Violations:  5 
    Expanding constraint grid to include 5 additional points...

    Audit count: 5
    Minimum criterion: 0.2343925
    Obtaining bounds...
Warning:  The solver was unable to satisfy the optimality tolerance for the maximization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'. 
    Violations: 0
    Audit finished.

Bounds on the target parameter: [-3.2646, 3.0224]

Instead, the output now looks like this:

Obtaining propensity scores...

Generating target moments...
    Integrating terms for control group...
    Integrating terms for treated group...

Performing direct MTR regression...
    MTR is not point identified.

Performing audit procedure...
    Solver: Gurobi ('gurobi')
    Generating initial constraint grid...

    Audit count: 1
    Minimum criterion: 0.2343829
    Obtaining bounds...
    Violations:  363 
    Expanding constraint grid to include 157 additional points...

    Audit count: 2
    Minimum criterion: 0.2343921
    Obtaining bounds...
    Violations:  72 
    Expanding constraint grid to include 72 additional points...

    Audit count: 3
    Minimum criterion: 0.2343925
    Obtaining bounds...
    Violations:  62 
    Expanding constraint grid to include 62 additional points...

    Audit count: 4
    Minimum criterion: 0.2343925
    Obtaining bounds...
    Violations:  5 
    Expanding constraint grid to include 5 additional points...

    Audit count: 5
    Minimum criterion: 0.2343925
    Obtaining bounds...
    Violations: 0
    Audit finished.

Bounds on the target parameter: [-3.2646, 3.0224]

Warning:  The solver was unable to satisfy the optimality tolerance for the maximization problem, so a suboptimal solution is returned. Tolerance parameters for the solver can be passed through the argument 'solver.options'.