In the interest of user-friendliness, would anyone know a way to overload ‘optimize’ to work conveniently for scalar input without crashing?
[please note I am not asking for opinions as to how good/bad an idea it would be - let’s assume I am willing to undertake any ‘risks’].
Of course, I can get it to work if I redefine my objective function to have one-dimensional Array argument and likewise my starting point, and then tell optimize I do not want Nelder-Mead, but let’s assume I would like to use optimize frequently and conveniently for scalar input and don’t want to go through the above steps every time. I would like (for my own use) to make the routine more user-friendly in this regard. Can anyone suggest a way for me to conveniently do this?
[PS I don’t mean the ‘Brent’s’ solution which apparently works - I want something fast]