Closed zauster closed 5 years ago
Hello,
first a small explanation of the arguments in feglmControl()
:
glm.control()
. Thus the algorithm converges if we can not improve the model deviance any further (relatively).To achieve convergence you could try the following:
However, if I got your model specification correctly than you might have a specification issue. Assuming that "bilFE" are the pair/dyadic fixed effects than it looks strange that you incorporate importer and exporter FE along with pairs. Pairs can be perfectly explained by the importer and exporter FE.
Thanks for the explanation!
2\. if the algorithm does not converge because step-halving fails, you may try to use a lower value of 'rho.tol' like 1.0e-15 which increases the number of tries to improve the deviance.
How do I know if the step-halving fails?
I will try your other recommendations and report.
However, if I got your model specification correctly than you might have a specification issue. Assuming that "bilFE" are the pair/dyadic fixed effects than it looks strange that you incorporate importer and exporter FE along with pairs. Pairs can be perfectly explained by the importer and exporter FE.
Well spotted, but that's just poorly named by me: expFE are exporter-time fixed effects. Since this is a panel, this should be fine.
Step-halving: In the case that step-halving fails you get an error and a notification that it has failed.
Model specification: Ok, then I assume that impFE are also importer-time FE, but what does yearFE do in the model? Or is it also named poorly?
Since I got no notification, step-halving seems to work fine. True, impFE are importer-time FE. yearFE stands for year fixed effects (a not-so-poor naming, I think ;-))
In this case impFE and expFE perfectly explain yearFE. As far as I know you can't identify anything with this specification and it is no surprise that the routine does not converge.
Yeah, you're right.
In ?feglm
you even state that "if it doesn't converge, the specification is probably wrong"...
I've eliminated the year fixed effects and re-estimated the model, which still doesn't converge. But I suspect that some of the variables might (more or less) coincide with some of the fixed effects. I will need to investigate more here.
Thanks for your help though!
Hey, I am trying a few different specifications of a gravity model. However, some specifications do not converge (I set the
iter.max
to 500). As suggested by you, I did center the dependent variable which actually helped for some specifications (converging now in ~20 iterations), but not for all.?feglmControl
states thatstep.tol
is deprecated and from the descriptions ofdev.tol
,center.tol
andrho.tol
I am not sure what to change/tweak. Do you have any suggestions what I could try so that the algorithm converges?Maybe this can help: the following table contains four specifications, the "CR" column is the specification that converged.
mTariffrate is a double, all variables ending in "entry" are dummies. The variables in between are doubles (in FI and CR spec), integer (in CM) or dummies (in DM).