Reputation: 5541
There is no information on how the direc argument of fmin-powell is supposed to be entered. All the scipy documentation for fmin_powell says is
direc : ndarray, optional
Initial direction set.
I thought that by giving direc=(0.1,0.1,1)
, I was telling it to start with step sizes of 0.1 for the first two fitting parameters and 1 for the third, which are needed in my case since the 3rd parameter is not sensitive to step sizes of 0.1. However, with this code it starts with 0.1 for all of the fitting parameters. If I try direc=(1,0.1,1)
, it uses an initial step of 1 for all parameters which destroys the fit, as the second parameter has a range of (0,1) and results in a division by zero if it ever goes negative. How are you supposed to set this argument?
Upvotes: 2
Views: 475
Reputation: 6313
For Powell minimization, the initial set of direction vectors don't need to be aligned with the axes (although normally they are). As the algorithm runs, it updates the direction vectors to be whatever direction is best in order to step downhill quickly.
But, imagine a case where the surface defined by your function is almost all flat near the starting point. Except, in one particular direction (not aligned with any axis) there is a narrow gulley that descends downward rapidly to the function minimum. In this case, using the direction of the gulley as one of the initial direction vectors might be helpful. Otherwise, conceivably, it might take a while for the algorithm to find a good direction to start moving in.
Upvotes: 1
Reputation: 5541
Apparently with wants vector sets, so direc=([1,0,0],[0,0.1,0],[0,0,1])
will do the job. However, still unclear on how this is arranged and functions, so not sure what would happen if some of those zeros were changed.
Upvotes: 0