Blog Topics...

3D plotting (1) Academic Life (2) ACE (18) Adaptive Behavior (2) Agglomeration (1) Aggregation Problems (1) Asset Pricing (1) Asymmetric Information (2) Behavioral Economics (1) Breakfast (4) Business Cycles (8) Business Theory (4) China (1) Cities (2) Clustering (1) Collective Intelligence (1) Community Structure (1) Complex Systems (42) Computational Complexity (1) Consumption (1) Contracting (1) Credit constraints (1) Credit Cycles (6) Daydreaming (2) Decision Making (1) Deflation (1) Diffusion (2) Disequilibrium Dynamics (6) DSGE (3) Dynamic Programming (6) Dynamical Systems (9) Econometrics (2) Economic Growth (5) Economic Policy (5) Economic Theory (1) Education (4) Emacs (1) Ergodic Theory (6) Euro Zone (1) Evolutionary Biology (1) EVT (1) Externalities (1) Finance (29) Fitness (6) Game Theory (3) General Equilibrium (8) Geopolitics (1) GitHub (1) Graph of the Day (11) Greatest Hits (1) Healthcare Economics (1) Heterogenous Agent Models (2) Heteroskedasticity (1) HFT (1) Housing Market (2) Income Inequality (2) Inflation (2) Institutions (2) Interesting reading material (2) IPython (1) IS-LM (1) Jerusalem (7) Keynes (1) Kronecker Graphs (3) Krussel-Smith (1) Labor Economics (1) Leverage (2) Liquidity (11) Logistics (6) Lucas Critique (2) Machine Learning (2) Macroeconomics (45) Macroprudential Regulation (1) Mathematics (23) matplotlib (10) Mayavi (1) Micro-foundations (10) Microeconomic of Banking (1) Modeling (8) Monetary Policy (4) Mountaineering (9) MSD (1) My Daily Show (3) NASA (1) Networks (46) Non-parametric Estimation (5) NumPy (2) Old Jaffa (9) Online Gaming (1) Optimal Growth (1) Oxford (4) Pakistan (1) Pandas (8) Penn World Tables (1) Physics (2) Pigouvian taxes (1) Politics (6) Power Laws (10) Prediction Markets (1) Prices (3) Prisoner's Dilemma (2) Producer Theory (2) Python (29) Quant (4) Quote of the Day (21) Ramsey model (1) Rational Expectations (1) RBC Models (2) Research Agenda (36) Santa Fe (6) SciPy (1) Shakshuka (1) Shiller (1) Social Dynamics (1) St. Andrews (1) Statistics (1) Stocks (2) Sugarscape (2) Summer Plans (2) Systemic Risk (13) Teaching (16) Theory of the Firm (4) Trade (4) Travel (3) Unemployment (9) Value iteration (2) Visualizations (1) wbdata (2) Web 2.0 (1) Yale (1)

Tuesday, November 30, 2010

The Vaults and Garden Cafe...

Coming at you, post-"Community Detection in Multi-Slice Networks," from the Vaults and Garden Cafe in Oxford...

Dr. Mason Porter gave a very nice and thorough seminar on applications of his method of detecting communities in multi-slice networks.  Applications ranged from financial networks to actual human brains (and everything in between).  The technique itself is deceptively simply:  one simply seeks the community partition that optimizes a well-known network quantity called modularity (where modularity is measured in terms of departure from some chosen null model).  However, actually implementing the technique can be extremely challenging.

I am interested in applying these techniques to international trade (which to Dr. Porter's knowledge has not yet been attempted).  To start, what I need is to find an appropriate null model for international trade networks.  I will then find a community partition that maximizes modularity relative to what one would expect given my null model.  Typically, null models are random network models...so which random network model is most descriptive on the international trade network?  What about Kronecker graphs?

The White Horse Pub...

I almost forgot...I had an excellent meal last night in the White Horse pub near Balliol College.  The pub itself was founded in 1591!  I had planned to go search out a good curry on Cowley St., but became distracted by a hand-scrawled chalkboard offering "Fresh Game Pie and Local Ale." 

So instead of a curry dinner...I had a rabbit, venison, and boar pie with potatoes.  I spent the remainder of my evening at the White Horse by the fire with two pints of a local ale called "The Village Idiot" and a newly purchased book: Marx: A Very Short Introduction...

Complexity Catastrophes...

On the train down to Oxford I read through almost all of the proceedings from the original Sante Fe Conference on economics as a complex system.  I found the following chapters to be particularly useful for economists:
  1. The Evolution of Economic Webs, Stuart Kaufman
  2. Persistent Oscillations and Chaos in Economic Models, Michele Boldrin
  3. Self-Reinforcing Mechanisms in Economics, W. Brian Arthur
  4. Computation and Multiplicity of Economic Equilibria, Timothy J. Kehoe
  5. Rational Expectations, Game Theory and Inflationary Inertia, Mario Henrique Simonsen
  6. The Global Economy as an Adaptive Process, John H. Holland
Of the above chapters, Kaufman's on the evolution of economic webs is by far the most thought-provoking.  I am particularly fond of his ideas on complexity catastrophes, as they parallel some of my own ideas on the dangers posed by overly dense connectivity in financial networks. 

Monday, November 29, 2010

Afternoon in Oxford...

After spending most of the early morning walking around Oxford trying to find a coffee shop that doesn't force you to pair for wifi service, I have now settled down to work on my international trade networks presentation in the Cafe Nero above the original Blackwell's bookstore...apparently the Blackwell's is close enough to Trinity College that I can access its eduroam wifi.

On a side note, I must say that  I am underwhelmed by the coffee shops that I have encountered in Oxford so far (with the exception of Green's Cafe)...Edinburgh wins easily using the coffee shop metric...

Are there any Oxford alums that are reading my blog? If so, suggestion regarding food, coffee, and pubs would be much appreciated...tonight I am going to go searching for a good curry over on Cowley St.

Saturday, November 27, 2010

Edinburgh at Dusk...

Took this photo from the top of Arthur's Seat around 4:30 pm...
 
I am heading south to Oxford University tomorrow to attend a seminar on the evolution of community structure in multi-slice networks at CABDyN.

I have never been to England before (I do not count layovers at Heathrow), and I am excited about this first (of hopefully many) visits to Oxford University.

Tuesday, November 23, 2010

Computational Model of Trade...

Just need to jot down the specifics of an idea I had about a computational model of trade with endogenous network formation...

The world consists of an exchange economy with N agents arranged in a circle.  Each agent is described by the following parameters:
  1. Parameter, r~U[0,1] describing their level of risk aversion.
  2. Parameter, v~U[a,b] describing their vision.  This vision parameter tells how many agents to the left and right are in an agents neighbourhood.  Vision could also be the same fixed v for all agents to simplify things.  Assume that agent's have perfect information about the endowments etc of all other agents in their neighbourhood/vision.
  3. Each agent is endowed with some amount of two goods sugar and spice.  Endowments could be distributed uniform on some interval.
  4. Agent have the same utility function which takes the amount of sugar and spice as arguments, and also must include risk aversion somehow.  I am open to suggestions as to what utility function would be most appropriate.
Agents would then have to decide whether or not to trade (if they wanted to trade at all) at "home" within their neighbourhood/vision or "abroad" by linking up with some other agent about which they know nothing (except the distributions of risk aversion, vision, etc.).  Of interest to me are the following...
  1. Do agents with higher levels of risk aversion trade at home more often? Do agents with less risk aversion trade abroad more often?
  2. What type of trade networks evolve through this process? Network structure within time steps and network structure aggregated across time steps would be of interest.
  3. What are the equilibrium properties of such a model?  Is there meaningful convergence?  If so, how fast?  Is the equilibrium Pareto efficient/Pareto optimal?
I wrote this down very fast, and no doubt left out details necessary to close the model, but I thought I better write it down lest I forget...

International Trade Network: A First Pass...

I will be presenting a talk on the structure of international trade at a networks workshop being held here at the University of Edinburgh.  What follows is a dump of my thoughts related to the subject which so far are largely based on my attempt to replicate recently published work on the structure of international trade network.

International Trade Network Data...
There are two principle sources of network data on international trade (that I have been able to find):
  1. Prof. Kristian Skrede Gleditsch at the University of Essex:  Data are from 1948-2000 and the primary source is the IMF.
  2. UN Comtrade: Data are from 1962-2009 and the primary source is of course the UN.  
  3. There is a third data source, the Economics Web Institute, that I would like to dissuade people from using even though they use Prof. Gleditsch's IMF data (without going into too much detail, the Economics Web Institute, seems to use an inconsistent methodology to assign edge weights (trade values) to countries when converting from Prof. Gleditsch's raw .asc files to .xls workbooks). 
If you would like to hear the gory details on the data validity issues feel free to contact me.

Hierarchical Clustering and Trade Network Density:
For the moment I am simply trying to replicate the work of the Deem et al. (2010) paper (linked to above).  I have applied a average linkage hierarchical clustering algorithm to the OECD international trade network as outlined in their paper.  Below are some plots of the cophenetic correlation coefficient (CCC) and network density for the international trade network for OECD countries using two different data-sets.  The first plot uses data entirely from the UN Comtrade database.  NBER recessions are marked with gray bars.  I downloaded the data by hand from Comtrade (commodity code is SITC ver. 1 AG0) and then used a Python script to clean and reorganize the .xls spreadsheets into more manageable text files.  Statistical analysis is done using SciPy, network analysis (so far) has been done using NetworkX, and plotting has been done using Matplotlib.     
The plot below is the CCC and network density for the international trade network for OECD countries using Prof. Gleditsch's IMF data for 1948-2000 and then UN Comtrade from 2001-2009 (commodity code this time is SITC ver. 3 AG0). 
There are some differences between the two plots of the CCC (I have not yet tested whether or not they are significantly different nor have I tested whether or not the CCC jumps significantly during/after recessions...this is on my to do list!).

Still to come:
  1. Dendrogram of identified clusters
  2. Results of community structure algorithm applications
  3. Weighted clustering algorithms and other graph measures
Basically I am just trying to learn to do network analysis using Python by applying the tools to an interesting topic...

Saturday, November 20, 2010

Ergodic Theory: A Verbal Monte-Carlo...

An interesting verbal example, a verbal monte-carlo if you will based on a post by Robert Vienneau.  I suspect one of my macro profs Sevi will like about ergodic and non-ergodic processes goes as follows:

Suppose I observe the consumption sample paths of 10,000 individuals over 10,000 units of time.  Let us also now make the completely implausible assumption that these 10,000 consumption paths were generated by the sample process.  Suppose that I pluck one sample path and look at the distribution across time.  Now suppose that I pluck out the observation at t=350 from each of the 10,000 sample paths and look at the distribution.  If this process was ergodic, then these two distributions should converge to one another in large enough samples. 

With ergodic processes, distributions across time and distributions across people should be the statistically the same (in large samples).  If the process is non-ergodic, then the distribution across people at a given moment in time and the distribution across time will not converge.  Sevi always comments about how summing (aggregating) across people, and summing across time are not always equivalent statements...is this the same as saying that economic processes in such cases are non-ergodic?  I don't know. 

Now let's go back and relax the ridiculous assumption that all agents have the same process that determines there consumption.  With heterogeneous agents even if each agent individually is following an ergodic process, the aggregate distributions across agents and across time will be a mixture of ergodic processes and therefore must be non-ergodic (I think).

Whether or not the above mentioned processes are stationary or non-stationary and why is still a mystery to me.  In Vienneau's example, the process he used in his actual monte-carlo was stationary but non-ergodic. 

Friday, November 19, 2010

Musings on Ergodic Theory...

There comes a time in every man's life where he feels that he should know more about ergodic theory than he does, for me that time arrived at 2:30 pm this afternoon while reading Brian Arthur's Increasing Returns and Path Dependence in the Economy

First I would like to prove to myself that Cosma Shalizi's assertions in this post are in fact correct.  Specifically he claims that...
"It is not true that non-stationarity is a sufficient condition for non-ergodicity; nor is it a necessary one."
This says that non-stationarity does not imply non-ergodicity.  I want to prove this by contradiction, so I need an example of a non-stationary process that is ergodic.
"It is not true that 'positive destabilizing feedback' implies non-ergodicity."
Again to prove by contradiction, I need an example of an ergodic process that exhibits positive destabilizing feedback 
"It is not true that ergodicity is incompatible with sensitive dependence on initial conditions."
Here I need an example of an ergodic process that exhibits sensitive dependence to initial conditions.  Cosma has already pointed out in his post that chaotic processes will generally serve as an example of an ergodic process with sensitive dependence on initial conditions
"It is not true that ergodicity rules out path-dependence, at least not the canonical form of it exhibited by Arthur's models"
Finally, I will need an example of an ergodic process that also exhibits path-dependence. 

I am currently reading Scott Page's essay on path dependence and I suspect that I will be able find several of the examples that I will need included in the text.

While all of this might seem very far removed from economics, I think understanding all of the above will provide useful constraints on the types of macroeconomic modelling techniques that I should pursue...at least this is my hope. 

Thursday, November 18, 2010

Quote of the Day...

"Equilibrium is blither"
-J.M. Keynes

Friday, November 5, 2010

Quote of the Day...

"I believe that something drastic has happened in computer science and machine learning. Until recently, philosophy was based on the very simple idea that the world is simple. In machine learning, for the first time, we have examples where the world is not simple. For example, when we solve the "forest" problem (which is a low-dimensional problem) and use data of size 15,000 we get 85%-87% accuracy. However, when we use 500,000 training examples we achieve 98% of correct answers. This means that a good decision rule is not a simple one, it cannot be described by a very few parameters. This is actually a crucial point in approach to empirical inference.
This point was very well described by Einstein who said "when the solution is simple, God is answering". That is, if a law is simple we can find it. He also said "when the number of factors coming into play is too large, scientific methods in most cases fail". In machine learning we dealing with a large number of factors. So the question is what is the real world? Is it simple or complex? Machine learning shows that there are examples of complex worlds. We should approach complex worlds from a completely different position than simple worlds. For example, in a complex world one should give up explain-ability (the main goal in classical science) to gain a better predict-ability."

-V.N. Vapnik

My question is: What, if any, applicability does this quote have to economics?  Should we be willing to trade-away explain-ability for predictability? 

Thursday, November 4, 2010

Self-Contained Development Environment...

My Mac and I have been having a fairly serious domestic dispute over which version of python I am allowed to use...tonight I finally won!  I have succeeded in setting up a self-contained development environment for python on my Mac using MacPorts... I highly recommend the Stack Overflow post on the subject.