Passing 2D argument into numpy.optimize.fmin error
It seems it is in fact impossible to pass a 2D list to numpy.optimize.fmin. However flattening the input f was not that much of a problem and while it makes the code slightly uglier, the optimisation now works.
Interestingly I also coded the optimisation in Matlab which does take 2D inputs to its fminsearch function. Both programs give the same output (y).
I currently have a function PushLogUtility(p,w,f) that I am looking to optimise w.r.t f (2xk) list for fixed p (9xk list) and w (2xk) list.
I am using the scipy.optimize.fmin function but am getting errors I believe because f is 2-dimensional. I had written a previous function LogUtility(p,q,f) passing a 1-dimensional input and it worked.
One option it seems is to write the p, w and f into 1-dimensional lists but this would be time-consuming and less readable. Is there any way to make fmin optimise a function with a 2D input?