Question

I am trying to use fmincon function in MATLAB to get values for 4 variables. I get a Warning:

Local minimum possible. Constraints satisfied.

fmincon stopped because the size of the current search direction is less than
twice the default value of the step size tolerance and constraints are 
satisfied to within the selected value of the constraint tolerance.

<stopping criteria details>

Optimization stopped because the norm of the current search direction, 6.854643e-07,
is less than 2*options.TolX = 1.000000e-06, and the maximum constraint 
violation, -3.940985e-05, is less than options.TolCon = 1.000000e-15.

Optimization Metric                                               Options
norm(search direction) =   6.85e-07                        TolX =   1e-06 (default)
max(constraint violation)  =  -3.94e-05                  TolCon =   1e-15 (selected)

I tried to change the TolFun and TolCon around from 1e-6 to 1e-10, but I still get the same message. Is there any other way I can make it converge

My code:
A = [1, 1, 0, 0];
b = 1;
lb = [0; 0; 0; 0];
ub = [1; 1; 1; 1];
Aeq = [];
beq = [];
noncoln = [];
init_guess = [.03;.93; long_term_sigma; initial_sigma];
%option = optimset('FunValCheck', 1000);
options = optimset('fmincon');
options = optimset(options, 'MaxFunEvals', 1000, 'MaxIter', 1000, 'Algorithm', 'active-set', 'TolCon', 1e-15, 'TolFun', 1e-15);
func = @(theta)Log_likeli(theta, ret_1000);
%[x, maxim] = fminsearch(@(theta)Log_likeli(theta, ret_1000), init_guess, options);
[x, maxim] = fmincon(func, init_guess, A, b, Aeq, beq, lb, ub, noncoln, options);
Était-ce utile?

La solution

Your problem has nine constraints. Maybe your problem can be strongly simplified to five constraints if you make theta_i =exp(x_i) and replace theta_i by this new variable in all places. Therefore, you have eliminated the positivity constraints and the new problem depends on x_i (x_i is your new variable). Ok.... You find the optimal value of x_i and calculate theta_i=exp(x_i). This is a very common substitution in Econometrics when you are dealing for instance with variances or volatilities.

You can also try another substitution (I have not seem before, but it seems to work) to eliminate all lb or ub... Make y=exp(x)/(1+exp(x)) [logistic function]. Now your problem is much easier, since it has only one constraint (given by A and b) and follow the same procedure above.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top