FMINCON does not optimize error function
Show older comments
I am trying to minimize the error between two price functions using the mean squared error. I want to minimize the error by changing five variables used in the first price function. After the optimization ran, the new error I get is huge (in the millions, I would expect getting a small decimal number) and the problem does not seem to be optimized at all. Someone please tell me what's wrong.
This is my code:
Z = [a, b, c, d, e];
MSE = @(Z) (immse(price1(Z(1),Z(2),Z(3),Z(4),Z(5)),price2));
initial =[0.1, 0.1, 0.1, 0.1, 0.1];
lb = [0, 0, 0, 0, 0];
ub = [1, 1, 1, 1, 1];
nonlcon = @myconstraint;
Z1 = fmincon(MSE,initial,[],[],[],[],lb,ub,nonlcon)
Accepted Answer
More Answers (0)
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!