cid-harvard / py-ecomplexity

Python package to compute economic complexity and associated variables
MIT License
63 stars 24 forks source link

ECI correlation with diversity #7

Closed MaxLugo closed 4 years ago

MaxLugo commented 4 years ago

Great program!

I have a question about the program. I look at the code where you calculate the ECI and PCI. You change the sign (well depending on the resulting vector) so the ECI is always positive correlated with the diversity (and the corresponding PCI). You did this because the sign in the program could be different (of course the opposite sign vector is also the same eigenvector associated with the same eigenvalue and I think python give you the 1st unit length vector found) so doing this you ensure this feature. If you don’t do this, you could end with Japan being the less complex country according to the ECI. So you rule out all those cases.

I made a similar program in python for municipalities in Mexico. I did the same. Doing this, you can replicate the book results, correct?

Right now I am working in crime data. For me it is not clear that the ECI in this case should be always positive correlated with the diversity.

Do you know if exist a math assumption or equation so we can ensure that the ECI should be always positive correlated with diversity?

Thank you for your advice and time,

matuteiglesias commented 4 years ago

Hi Max Yes, indeed, the ECI does a clustering and sorting but does not tell you which side is the positive one, or complex one. Let me reply in detail later, or someone else may have a good reply for you too. Best Matias

Sent from my iPhone

On Jul 12, 2019, at 7:25 PM, Max Lugo D notifications@github.com wrote:

Great program!

I have a question about the program. I look at the code where you calculate the ECI and PCI. You change the sign (well depending on the resulting vector) so the ECI is always positive correlated with the diversity (and the corresponding PCI). You did this because the sign in the program could be different (of course the opposite sign vector is also the same eigenvector associated with the same eigenvalue and I think python give you the 1st unit length vector found) so doing this you ensure this feature. If you don’t do this, you could end with Japan being the less complex country according to the ECI. So you rule out all those cases.

I made a similar program in python for municipalities in Mexico. I did the same. Doing this, you can replicate the book results, correct?

Right now I am working in crime data. For me it is not clear that the ECI in this case should be always positive correlated with the diversity.

Do you know if exist a math assumption or equation so we can ensure that the ECI should be always positive correlated with diversity?

Thank you for your advice and time,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

MaxLugo commented 4 years ago

Thank you Matias for your quick response. I will wait for any notice. Thank you again.

agomezlievano commented 4 years ago

Hi Max,

In what follows I assume that you are computing the ECI based on a matrix of municipalities and the prevalence/presence of crimes of different types across those municipalities. Is this right?

To your question "Do you know if exist a math assumption or equation so we can ensure that the ECI should be always positive correlated with diversity?", the answer is no. There is no equation that says that ECI should be positively correlated with diversity. This is because there is no "first principles" derivation (yet) of the ECI that guarantees that it is a mathematical object that actually estimates statistically such a thing like "complexity". We know what eigenvectors do in general, but the latter issue of formally linking the concept of complexity to one specific eigenvector of a specific type of matrix is a still current open research problem.

Having said that, let us assume that ECI does indeed quantify something like "economic complexity", i.e., let us assume that it magically estimates the number of capabilities present in a city. Then, why is it surprising to you that most diverse places are also the places that have the highest "criminal complexity index"? The most diverse cities may also be diverse regarding the "criminal knowhow" available to criminals. Thus, they can recombine all this criminal knowhow in more ways, and commit not only more crimes, but also more different types of crimes, and more "complex" and "sophisticated" crimes. Or maybe I misunderstood your question...?

MaxLugo commented 4 years ago

Hi Andres,

First of all, thank you for your reply. Yes, I am using a municipality matrix and the associated crime. I already created the program and calculated an index. The program also satisfy that higher crime diversity will be associated with higher crime "complexity". As you mention, some places acquire capabilities to produce more complex crime related to the diversity. I was worry if I was missing something in between. So your answers clarify the issue.

Thank you.