davidrpugh / assortative-matching-large-firms

Code for solving Eeckhout and Kircher model of assortative matching between heterogenous firms and workers.
MIT License
3 stars 8 forks source link

Estimation code #14

Open davidrpugh opened 9 years ago

davidrpugh commented 9 years ago

@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.

crisla commented 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?

davidrpugh commented 9 years ago

@crisla

You want to be using scipy.optimize.minimize with method='l-bfgs-b' or 'method=SLSQP' and theboundskeyword argument to be something likebounds=[(0, 1), (0, 1), (0, None)]foromegaA,omegaB, andsigmaA` respectively.

crisla commented 9 years ago

@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.