I’m trying to use the ‘fmincon’ optimization solver to maximize a particular objective function given below:
function ei=Calc_EI(k1k2,dmodel,Cbin_,F_)
.
.
.
ei = EI_SSE(mu, sigma, y, sse_min);
k1k2,dmodel,Cbin_ and F_ are variables provided into the objective function. Hence, the subsequent calculation of ei (as seen above).
This objective function is then provided into the fmincon optimization solver:
myEI=@(k1k2)(Calc_EI(k1k2,dmodel,Cbin_,F_));
[xkEI,fvalEI,exitflagEI,outputEI,lambdaEI] = fmincon(myEI,x0,[],[],[],[],lb,ub,[],options);
In the course of trying to run the solver, there was an error message:
“Undefined function or variable ‘dmodel’.
Error in @(k1k2)((Calc_EI(k1k2,dmodel,Cbin_,F_)))
Error in fmincon (line 635)
initVals.f = feval(funfcn{3},X,varargin{:});
Error in test_calibration (line 45)
[xkEI,fvalEI,exitflagEI,outputEI,lambdaEI] = fmincon(myEI,x0,[],[],[],[],lb,ub,[],options);
Caused by:
Failure in initial user-supplied objective function evaluation. FMINCON cannot continue.”
IT SEEMS THE fmincon solver IS NOT SEEING THE VARIABLE, ‘dmodel’ and probably the same will apply to Cbin_ and F_. PLEASE HOW CAN I MAKE THE fmincon Solver TO SEE THESE VARIABLES FOR THE CALCULATION? THESE VARIABLES HAVE ALREADY BEEN PROVIDED IN THE OBJECTIVE FUNCTION CALCULATION.
I LOOK FORWARD TO YOUR REPLY. THANK YOU.