Open davidrpugh opened 9 years ago
@davidrpugh
Quick question about scipy.optimize.fmin:
The parameters of the production function(omega a, omega b,sigma a) are bounded. How can I include those constrains on the objective function? Maybe penalizing very heavily values out of bounds?
@crisla
You want to be using scipy.optimize.minimize with method='l-bfgs-b' or 'method=SLSQP' and the
boundskeyword argument to be something like
bounds=[(0, 1), (0, 1), (0, None)]for
omegaA,
omegaB, and
sigmaA` respectively.
@Falter89
The fact that the minimizers stop at the wrong parameters is that every time they step into the "forbidden area" the error gets bigger! When calculating slopes, that means that making a mistake further down the line is worse, so don't make any more progress after certain point -which is not the optimum. As the minimizer goes more than once into the corner solutions to compute this (f.e. omeaga_a=1.0), this does happen and makes the optimizer stop earlier than it should.
This could also explain why for me the SLSQP method does work quite well - I do ger _fewer_ error messages along the path.
A solution to this would be to give bounds to parameters such that the solver does not explode. We can make a "sensitivity notebook" iterating with extreme parameters until we find some that mean the solve model function does not explode.
@crisla
We need to start thinking about an estimation/identification strategy for the model. Philipp and Jan would be able to help out with this I should think.