davidrpugh / pyAM

Python package for solving assortative matching models with two-sided heterogeneity.
MIT License
0 stars 4 forks source link

Relative size of omega_A and omega_B #17

Open Falter89 opened 8 years ago

Falter89 commented 8 years ago

Hi David, hi Cristina,

my estimation requires a steep relationship between the wage and size. I generally get this by making omega_A a lot smaller than omega_B. However, when omega_A is too small/ omega_B is too big, possibly related to their relative size, the solver breaks down. Lowering the alpha helps, but now I'm at xalpha=0.0001 and my are F_params = {'omega_A':0.1, 'omega_B':0.4, 'sigma_A':0.7, 'sigma_B':1.0 , 'Big_A':1.12}. I would like to increase the difference between the omegas even more, but this is making the solver break down quite often. 'omega_A':0.15, 'omega_B':0.5, also works, but I haven't been able to get them further apart than this.

I wanted to know if you had similar problems and maybe see if there is something in the case other than lower alpha that helps. I experimented with increasing the degree too, but that wasn't that helpful.

crisla commented 8 years ago

I think i know what that happens (sorry for the size, copy-paste in mac is so annoyingly complicated):

screen shot 2015-10-22 at 14 15 15

Moral of the story: omega_A and omega_B should not be close to 0, and if you want monotonically increasing firm size, omega_B > omega_A.

Notice also how the relative shape of the distributions does not matter for this: H(x) is not relevant under normalisation. So playing around only with the parameters of the distributions should not cause, a priori, a crash. This suggests to me that we should use a two-step approach: solve for all normal parameters with fixed distributions first, then change the distributions, solve for all the other parameters again, and so on.

Only the sorting function mu(x) and it's slope can do something: for example, imagine that the sorting function is relatively flat at the end (for high types) : then mu'(x) is pretty small and so firm size can start decreasing at the end.

This can happen if the sorting function mu(x) is concave, if mu(x) is convex, then this is not an issue (or it is an issue for low-type firms). So if you want a really steep relationship between firm size and wage that's what you should be shooting for. If I remember correctly David got to that by playing with the distributions of x and y. So that's what should be our aim now: what distributions do we need to generate convex mu(x) functions?

Falter89 commented 8 years ago

Hi,

From your derivation it looks like that not only can both omegas not be close to 0, but they also cannot be too close to 1. This means that as I seemed to find when playing around with the solver, there is a limit to how much bigger omega_b can be. Otherwise the derivative gets too close to 0 and the silver breaks down. So maybe it is not possible to get a steep-enough relation between wage and size using this production function. Although the result I got so far doesn't look too bad.

Does changing the distribution work for you? I tried solving the model changing the sigma, but it just breaks down.

Best, Julia

Am 22.10.2015 um 22:14 schrieb Cristina notifications@github.com:

I think i know what that happens (sorry for the size, copy-paste in mac is so annoyingly complicated):

Moral of the story: omega_A and omega_B should not be close to 0, and if you want monotonically increasing firm size, omega_B > omega_A.

Notice also how the relative shape of the distributions does not matter for this: H(x) is not relevant under normalisation. So playing around only with the parameters of the distributions should not cause, a priori, a crash. This suggests to me that we should use a two-step approach: solve for all normal parameters with fixed distributions first, then change the distributions, solve for all the other parameters again, and so on.

Only the sorting function mu(x) and it's slope can do something: for example, imagine that the sorting function is relatively flat at the end (for high types) : then mu'(x) is pretty small and so firm size can start decreasing at the end.

This can happen if the sorting function mu(x) is concave, if mu(x) is convex, then this is not an issue (or it is an issue for low-type firms). So if you want a really steep relationship between firm size and wage that's what you should be shooting for. If I remember correctly David got to that by playing with the distributions of x and y. So that's what should be our aim now: what distributions do we need to generate convex mu(x) functions?

— Reply to this email directly or view it on GitHub.

davidrpugh commented 8 years ago

Apologies for tardy replies. I recall being anle to get solver works for pretty arbitrary omegas. I was also anle to change sigmax and get mu to switch from concave to convex.

What version of pyam do you have? On 23 Oct 2015 07:27, "Falter89" notifications@github.com wrote:

Hi,

From your derivation it looks like that not only can both omegas not be close to 0, but they also cannot be too close to 1. This means that as I seemed to find when playing around with the solver, there is a limit to how much bigger omega_b can be. Otherwise the derivative gets too close to 0 and the silver breaks down. So maybe it is not possible to get a steep-enough relation between wage and size using this production function. Although the result I got so far doesn't look too bad.

Does changing the distribution work for you? I tried solving the model changing the sigma, but it just breaks down.

Best, Julia

Am 22.10.2015 um 22:14 schrieb Cristina notifications@github.com:

I think i know what that happens (sorry for the size, copy-paste in mac is so annoyingly complicated):

Moral of the story: omega_A and omega_B should not be close to 0, and if you want monotonically increasing firm size, omega_B > omega_A.

Notice also how the relative shape of the distributions does not matter for this: H(x) is not relevant under normalisation. So playing around only with the parameters of the distributions should not cause, a priori, a crash. This suggests to me that we should use a two-step approach: solve for all normal parameters with fixed distributions first, then change the distributions, solve for all the other parameters again, and so on.

Only the sorting function mu(x) and it's slope can do something: for example, imagine that the sorting function is relatively flat at the end (for high types) : then mu'(x) is pretty small and so firm size can start decreasing at the end.

This can happen if the sorting function mu(x) is concave, if mu(x) is convex, then this is not an issue (or it is an issue for low-type firms). So if you want a really steep relationship between firm size and wage that's what you should be shooting for. If I remember correctly David got to that by playing with the distributions of x and y. So that's what should be our aim now: what distributions do we need to generate convex mu(x) functions?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/davidrpugh/pyAM/issues/17#issuecomment-150488171.

crisla commented 8 years ago

I have version 0.2.1a0.

About wages:

Wages and sizes in the model are somewhat inversely related. Recall that

w'(x) = Fx/theta(x)

So the slope of the wage function is inversely related to size: if you get big firms at the end you also get less steep wages if Fx grows slower than theta(x) (that is, Fxx < theta'(x)).

Now what happens when we fiddle with the omegas? They enter both in Fx and theta(x). If by reducing omega_a you get increasing theta(x), you are also making Fx smaller - therefore getting the correlation of wage and size weaker - steeper theta(x), flatter w(x).

But there is an alternative: you can change the distributions of y and x, changing what mu'(x) is going to be, as it depends on the ratio of the two density functions. So you can get bigger firms leaving the Fx unchanged by making sure there are enough high type workers relative to firms.

So we need to play around with the distributions to get a monotonously increasing theta(x) without dampening the wage. I think it's doable, and once I solve my pycollocation problems I'll give it a go.