I am attempting to perform a numerical optimisation of a "black box" function in Mathematica. Schematically it goes like this:
NMinimize[{comb[x,y,z], x > 0}, {x,y,z}]
where comb[x,y,z] is defined similarly to this:
comb[x_,y_,z_] := Module[{},
Print[x,y,z];
M = FindMaximum[SkewNormal[a,x,y,z], {a,x}] // First;
val = f[x,y,z,M];
Return[val];
];
However, all of the minimisation functions I have tried seem to not immediately provide comb[x,y,z] with numerical values, and it ends up trying to evaluate the FindMaximum with symbolic values for x,y,z (which is easily verified because the Print[x,y,z] also evaluates symbolically). The Findmaximum thus fails (FindMaximum::nrnum: The function value blah blah is not a real number) and so the minimisation fails.
How do I fix up the evaluation order so that the sub-functions of comb are evaluated with numerical values?
NMinimize
recently was solved in other thread by Daniel Lichtblau. – Hormonal