A stupid workaround is simply to replace b with -b:
q[a_?NumericQ, b_?NumericQ] :=
NIntegrate[Exp[a*(x^2 - 1) - b*(x^4 - 3.1)], {x, -Infinity, Infinity}];
yy = FindMinimum[{q[a, b], b > 0}, {{a, -2}, {b, .004}}]
{4.13273, {a -> -0.5, b -> 8.27074*10^-8}}
without any warnings. But it's a pity that FindMinimum behaves so inflexibly.
Of course we also can overcome the b >= 0 case by defining the objective function in a special way:
Clear[q]
q[a_?NumericQ, b_?NumericQ] /; b < 0 :=
(res = NIntegrate[Exp[a*(x^2 - 1) + b*(x^4 - 3.1)], {x, -Infinity, Infinity}];
Sow[{a, b, res}]; res);
q[a_?NumericQ, b_?NumericQ] /; b >= 0 := 100;
yy = Reap[FindMinimum[{q[a, b], b < 0}, {{a, -2}, {b, -.004}}]];
yy[[1]]
yy[[2, 1]] // Length
FindMinimum::eit: The algorithm does not converge to the tolerance of 4.806217383937354`*^-6 in 500 iterations. The best estimated solution, with feasibility residual, KKT residual, or complementary residual of {3.08422*10^-18,0.411143,3.11538*10^-18}, is returned. >>
{4.13273, {a -> -0.499915, b -> -5.31328*10^-6}}
4043
What a mess! We have got 4043 evaluation points and lesser precise result while with the "stupid" workaround FindMinimum uses only 101 point:
Clear[q]
q[a_?NumericQ, b_?NumericQ] :=
(res = NIntegrate[Exp[a*(x^2 - 1) - b*(x^4 - 3.1)], {x, -Infinity, Infinity}];
Sow[{a, b, res}]; res);
yy = Reap[FindMinimum[{q[a, b], b > 0}, {{a, -2}, {b, .004}}]];
yy[[2, 1]] // Length
101