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)
Showing posts with label Complex Systems. Show all posts
Showing posts with label Complex Systems. Show all posts

Thursday, June 7, 2012

5-6 June 2012 at the 2012 CSSS...

For the past two days the focus has been on tools for analyzing non-linear dynamical (and specifically chaotic) systems.   We have been using a program called TISEAN to do most of the analysis.  There also seem to be a number of R packages for doing non-linear times series analysis: RTisean, tsDyn, tseriesChaos, etc.

Henon Map:  

Our first task was to simply use TISEAN to generate some trajectories of the Henon map, plot them using our favorite plotting tool (at the moment I am working on improving my Python coding so I am using matplotlib) and then analyze the power spectrum (sometimes called spectral density).  TISEAN's version of the Henon map is:

xt+1 = 1 - Axt2 + Byt
yt+1 = xt

For A=0.8 and B=0, the attractor is a simple 2-cycle which means that a plot of the trajectory of the map in state space will yield two points:
 However, for A=1.4 and B=0.3, the Henon map displays chaotic dynamics:
Power Spectrum: A good place to start the analysis of times series data is to examine the power spectrum (or spectral density) of the data.   For the Henon map with A=0.8 and B=0, the attractor is a 2-cycle which implies that the dominant frequency should be 1/2.  
Note the above plot has a single "spike" at a frequency of 0.5.  What other frequencies are present in the times series generated by the Henon map?  Given that the map is a 2-cycle, in theory, there should be only a single frequency present in the data.  Although my computer can represent much smaller numbers, the smallest number that my computer can distinguish as being distinct (i.e., my machine ε) is 2.2204460492503131e-16.  The other "spikes" in the above plot are thus non-sensical results of my computer doing calculations with numbers that are too small for it to handle properly.  This is a good example of arithmetic underflow.

Given that the Henon map with A=1.4 and B=0.3 exhibits chaotic dynamics we expect that the power spectrum should exhibit spikes at all frequencies.

The Lorenz System: 

Next we want to plot some trajectories the Lorenz System and then analyze the resulting power spectrums.  Classic model of chaos developed by Edward Lorenz to model weather/climate systems.  For parameter values R=15, S=16, B=4 the system exhibits a unique fixed point attractor...
...or in 3D if you prefer:
The power spectrum for the unique fixed point attractor looks as follows:
One gets much more interesting dynamics out of the Lorenz system simply by changing R.  For parameter values R=45, S=16, B=4 the system exhibits chaos:
For R=45, the power spectrum exhibits power at all frequencies:

Python code (and the data files if you do not have TISEAN installed) for replicating the above can be found here.

Monday, June 4, 2012

Monday 4 June 2012 at the 2012 CSSS...

Today's lecture, given by Prof. Liz Bradley, focused on the basics of non-linear (mostly chaotic) dynamics in both discrete and continuous time.  Much (all?) of the material in the lecture I had already encountered before in my own reading, but it was nice to get a refresher.  What follows is my summary of our discussion of the dynamical properties of that classic example of chaotic dynamics in discrete time, the logistic map.  The seminal reference for the logistic map is probably the 1976 Nature paper by Robert May.

The Logistic Map is an innocent looking non-linear equation:

Xt+1 = X(1 - Xt)

where the state space of the model is the unit interval [0, 1] and r is a parameter that varies on (0, 4].  

Some trajectories of the logistic map for various values of r:
If  0 < r ≤ 1, then the dynamics are trivial: the model will converge to X = 0 no matter the initial condition.  Suppose the r = 2.  In this case, the dynamics of the model are also pretty boring: convergence to a unique fixed point.  No matter the initial condition, if r = 2, all trajectories of the logistic map will converge (quite quickly) on a unique steady state value of 1/2.

Now suppose that r = 2.919149.  In this case, the result is still convergence to a unique fixed point, however the dynamics are more interesting: the trajectories now exhibit dampened oscillations.
For values of r satisfying 3 < r < 3.45 (roughly!), you get a 2-cycle:
For r = 3.8285, one gets the famous 3-cycle which is one of the generally accepted indicators of chaotic dynamics (note I have changed the initial condition from 0.2 to 0.5 to eliminate the transient and thus making the cobweb diagram a bit cleaner):
Finally, for r = 4 we get an example of chaotic dynamics.  Note that the deterministic trajectory for the logistic map looks incredibly "random."
3D plot of the phase space for the logistic map:
One of the reasons why models with chaotic dynamics, such as the logistic map, exhibit sensitive dependence to initial conditions, is that such maps repeatedly "stretch and fold" the state space over which they are defined.  While 2D phase plots give a sense of how the logistic map "stretches" the state space,  a 3D phase plot is a really cool way to see how the logistic map "folds" the state space.
If you are interested, the Python code to replicate the above graphics can be found here.  I am still working on the code for the bifurcation diagram, estimating Feigenbaum's constant, and for calculating Lyapunov exponents.  

Thursday, March 1, 2012

Santa Fe bound!

I have just received notification that I have been accepted into the 2012 Complex Systems Summer School at the Santa Fe Institute!  Attending the Santa Fe institute's summer school has been a dream of mine ever since I was made aware of its existence some 6 years ago...

Thursday, May 5, 2011

Complexity Economics

I embed the videos of the Complexity Economics Panel from the recent INET conference in Bretton Woods for those interested. On a related note, I am wondering what (if any) connections exist between the complex systems notion of the economy as a disequilibrium system, and the existing economic literature on disequilibrium dynamics...

Introduction by Eric Beinhocker:


Brian Arthur:


Ian Goldin:


Thomas Homer Dixon:


Moderated Q/A:

Wednesday, May 4, 2011

The Use of Knowledge in Society...

I first came across this paper while doing a bit of outside reading during the MSc.  It is one of my all-time favorites, and has strongly influenced my interests in the complex systems approach to economics in general, and networks in particular. 

I quote my favorite passage:
"The problem is in no way solved if we can show that all the facts, if they were known to a single mind (as we hypothetically assume them to be given to the observing economist), would uniquely determine the solution; instead we must show how a solution is produced by the interactions of people each of whom possess only partial knowledge.  To assume that all the knowledge to be given to us as the explaining economists is to assume the problem away and to disregard everything that is important and significant in the real world."
What I take from the above passage is that it is not enough to show that an equilibrium exists, what is needed is to show a process of dynamic adjustment that describes how such an equilibrium can be reached given that agents have only partial knowledge of the world.  I remember as an MSc student being deeply skeptical of the utility of the Arrow-Debreu general equilibrium framework because it showed only that an equilibrium existed and did not specify a dynamic process of through which that equilibrium was obtained.  Needless to say, I was very excited when I came across this paper as it indicated to me that I was not alone in my concern. 

On a related note, for those interested in a another way of modeling the price system, I highly recommend Growing Artificial Societies.  The book is slightly dated now (most of the work was done in the late 1980's early 1990's).  The authors use a computational model/simulation to show how (and under what conditions) market prices in an economy consisting of heterogeneous agents, operating under only limited knowledge of their environment, can converge to something resembling an equilibrium prices.  Perhaps even more interestingly they delve into when prices should not be expected to converge.  NetLogo has a version of the model that replicates most (all?) of the results from the book.

Upon reflection, I think the economics of Keynes and Hayek are in many respects closer than people think.  This is particularly true if one's knowledge of the differences between Keynes and Hayek comes from the following two rap videos from YouTube.

Sunday, February 27, 2011

Second Life...

Does this qualify as a model of a real economic system? Or as an actual real economic system?  Apparently the official Second Life currency, the Linden dollar, has been fairly stable over the past 3-5 years (the Linden dollar is apparently pegged to the U.S. dollar).  What amazes me the most second-most is that, at least according to the Wikipedia article, the owners of Second Life have developed their own monetary policy in order to maintain the peg!  What amazes (but does not surprise me) the most, is that the Gini coefficient hovers around 0.9 (i.e., 90% of wealth is held by 10% of users)!  Although this estimate is probably not very scientific, I would tend to be much more sceptical of a claim that inequality was low...


Second-Life should start publishing data...actually no, they shouldn't...if they do start publishing data then I am likely to get distracted from doing more productive research...

Monday, January 31, 2011

An oldie but goodie ftom Axel Leijonhufvud...

Here is a snippet from an old blog post by one of my favourite economists, Axel Leijonhufvud:
"Systemic problems
The currently pressing problems all concern instabilities that have been neglected in stable-with-frictions macro theory. They constitute three themes I discussed in more detail in previous Vox columns (Leijonhufvud, June 2007, January 2009, and July 2009).
  • Instability of leverage. Competing to achieve rates of return several times higher than returns in industry, financial institutions were at historically high levels of leverage towards the end of the boom, earning historically minimal risk spreads – and carrying large volumes of assets soon to be revealed as “toxic.”
  • Connectivity. In the US, under the Glass-Steagall regulations, the financial system had been segmented into distinct industries each characterized by the type of assets they could invest in and liabilities they could issue. Firms in different industry segments were not in direct competition with each other. Deregulation has dramatically increased connectivity in the global network of financial institutions. The crisis of the American savings and loan industry in the 1980s, although costly enough, was confined to that market segment. The present crisis also started in American home finance but has spread and amplified across the world."
The whole post (plus all the linked materials) is well worth reading.  The above snippet gets at the heart of what I am trying to show with my first year PhD paper.  Increasing connectivity in the financial sector (which I am modelling as increasing network density), increases the leverage of financial institutions (either because increasing connectivity lowers borrowing costs, financial institutions are risk averse, etc).  Increased leverage makes the financial system fragile and vulnerable to idiosyncratic shocks despite the increased diversification brought about by the additional connectivity.

Thursday, January 20, 2011

The BoE is interested in my area of research...

Andrew Haldane, who is the Bank of England's Executive Director of Financial Stability, and his co-author Robert May have recently published a paper in Nature that focuses on the dangers to the stability of the financial system caused by too much complexity in the structure of financial networks.  It is an excellent, easy read and definitely gives the flavour of the major results so far regarding systemic risk and financial network structure.

One of the many insights referenced in the paper is the idea that regulatory policy should take a more systemic approach (as opposed to focusing regulatory policy at the level of the individual institution).  This reminded me of a recent post by Cosma Shalizi questioning the need for microfoundations in macroeconomics.

Andrew Haldane will be coming to Edinburgh in March to give a lecture on financial stability, and I will definitely be in attendance...

Tuesday, November 30, 2010

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, October 25, 2010

Slight PhD Research Detour...

My PhD research has taken a slight detour over the last couple of days.  In order to do theory I need to work with data, and there is just not a lot of publicly available data on financial networks at the moment.  So I decided that for the time being I am going to do some empirical research on trade networks using data from the UN Comtrade database

The inspiration for my research comes from the the following paper on the evolution of international trading networks.  The paper basically postulates that international trade is best described as a specific type of evolutionary system that satisfies the following three requirements:
  1. The dynamics of the international trade system are "slow" to respond to environmental change
  2. That environmental change is present
  3. Information is exchanged between agents in the system
The authors have studied this type of evolutionary system in previous research and two of their papers on the details of their evolutionary theory can be found here and here.  Their theory makes three specific predictions about the evolution of international trade networks:
  1. Decreased modular/hierarchical structure in the world trade network increases the sensitivity of the network to recessionary shocks
  2. Decreased modular/hierarchical structure decreases the rate of recovery from shocks
  3. Recessions (negative shocks) should spontaneously increase the modular/hierarchical structure in the trade network
According to the authors, all three of these predictions are borne out in the data...I am going to attempt to replicate their results.  Their theory implies that the modular/hierarchical structure that forms in response to environmental shocks (recessions) increases the resistance to and rate of recovery from shocks (recessions).  Globalization reduces modular/hierarchical structure in the global trade network and thus should lead to increasingly large recessions and a decreased rate of recovery from these recessions.

I have already written Python scripts to download the UN trade data and combine it into a single text file for use in the analysis.  I will be building an on-line code repository in the near future where people can come and download my code so that they can attempt to replicate MY results...

I would be interested in comments from readers concerning what standard economic theory I could bring to bear on this problem...I suspect that there is quite a bit of support for this line of research in more mainstream economics, but I could be wrong...

Saturday, October 16, 2010

A Great Loss...

Benoit Mandelbrot died today...a great light has gone out...Such an intellect comes only a few times each generation.  He was a truly original thinker, and one of my role models...

He will be truly missed.

Tuesday, October 5, 2010

Sound Familiar...

For any readers who happen to be interested in economics take a look at the following article on Wikipedia...sound familiar?

I came across a reference to the "ecological fallacy" in Daniel Katz's slides on Schelling's segregation model...

For Those Interested in ABM...

I came across an excellent set of lecture slides from Daniel Katz at Michigan on computational modeling for social sciences, and for those interested in NetLOGO there are an excellent set of introductory tutorials on Youtube

Sunday, September 12, 2010

Modeling Financial Instability...

Most intriguing paper by Steve Keen on Financial and Economic Breakdown: Modeling Minsky's Financial Instability Hypothesis.  Using Goodwin's limit cycle model as his foundation, Keen extends the model to account for the four keys to Minsky's idea:
  1. Tendency of capitalists to incur debt on the basis of euphoric expectations
  2. The importance of long-term debt
  3. The destabilizing impact of income inequality
  4. The stabilizing role of government
Inclusion of Minsky's ideas converts Goodwin's stable but cyclical system into a chaotic one with the possibility of a divergent breakdown (i.e., depression)...

My interest in this paper is that it is the first attempt that I have come across so far that presents a mathematical model of Minsky's Financial Instability Hypothesis.  I would like to try to somehow incorporate these ideas into a network model...here is a link to a paper by Gallegati et al that uses an agent-based approach to model some of these ideas.  

Friday, September 10, 2010

Crises, Evolution, and Growth...

Sean passes along this interesting story from British economics blogger Chris Dillow.

Wednesday, September 8, 2010

Interesting MTG with Informatics Profs...

I just had a very interesting discussion about my research agenda and the possibility of pursuing a significant portion of my PhD work through the School of Informatics.  The profs I spoke with were very excited about my research agenda, as it overlapped significantly with some of their own work.  They also pointed me towards courses on networks and agent-based modelling that start in a few weeks that I will be able to take...

Wednesday, August 25, 2010

Idea About Regulatory Policy Design...

Fair use warning!!!  Totally speculative blog post...

In my last post I mentioned that a major difficulty for policymakers in designing regulatory policy was how to develop a framework to mitigate systemic risk in an environment where there is a trade-off between mitigating individual risk and systemic risk.  I have an idea...

Study the evolution of communities of agents within the financial sector using network data and some set of risk measures.  In theory, at least, the agents within these evolving community structures should be affected by some common key drivers of individual risk (given that they are in the same community).  Then try to develop a regulatory framework that encourages the individuals within communities to mitigate community risk...the idea is that this difficult coordination task would be made easier given that the agents are affected by a common set of risk drivers.

This idea implicitly assumes that, in terms of mitigating systemic risk, mitigating risk individually at the community level is somehow better than mitigating risk individually at the level of the individual agent.  But is there any basis for this belief?  I have no idea...perhaps this idea is only a good one insofar as it makes the policymakers job easier...but I am not even convinced it does...

Major Insight of the Literature on Financial Networks...

Keshav passed along some links to papers on financial networks that are being presented at the EEA conference that he is attending.  I have glanced over the abstracts from the papers that and they all remind/reinforce what I think is the major insight from the networks literature on systemic risk in the financial sector that was extremely under appreciated until very recently:

Individuals agents in the financial sector who are rationally pursuing strategies that minimize their individual idiosyncratic financial risks can actually cause substantial increases in overall/systemic risk in the financial sector.  If individual agents and their risk mitigation strategies existed independently of one another (i.e., did not interact) then minimizing their risks individually would surely (I think) lead to a minimization of systemic risk as well.  The key issue that the network literature focuses nicely on is that financial agents and their strategies do interact with one another and that these interactions can create both stabilizing and destabilizing (depending on circumstances) feedback effects.  Oftentimes the destabilizing feedback effects dominate...

Generally speaking I think most policy makers would have assumed that a regulatory/incentive structure in the financial system that encouraged all players to mitigate individual risk would also be a good regulatory framework for mitigating systemic risk.  Based on recent empirical evidence and research I would say that this notion should be discredited...Given that there seems to be a trade-off between mitigating individual and systemic risk, the hard part from a policy perspective is how do you a design a regulatory regime that encourages mitigation of some weighted average of individual vs. collective/systemic financial risk.

Different papers in the financial networks literature look at a variety of specific issues that relate to systemic risk, but ultimately it is the trade-off between mitigating individual risk and mitigating systemic risk that continues to emerge.  Maybe I am wrong about my interpretation of the literature...but for me at least, this has been my major takeaway...

Thursday, August 19, 2010

More on my PhD Research Agenda...

The following papers are going to form my point of departure for my PhD research:
  1. Liaisons Dangereuses: Increasing Connectivity, Risk Sharing, and Systemic Risk-This paper by Battiston et al has all of the ingredients that I am interested in studying (specifically credit networks and their relationship to systemic risk).  An excellent slide deck that covers the key concepts and conclusions of the paper can be found here.  In their model, as the network becomes more dense (i.e., more inter-connected) individual risk decreases because more connections allow each individual to diversify idiosyncratic shocks.  However, increasing network density also increases the ability of negative shocks to propogate through the entire network (instead of being locally contained) and thus leads to an increase in systemic risk.  
  2. Financially Constrained Fluctuations in an Evolving Network Economy-This paper by Delli Gatti et al is a nice model of credit networks between firms and banks.  It includes both inside or trade credit as well as outside or bank credit.  The interaction effects of the firms financial positions generates business cycles (similar to Minsky's financial instability hypothesis).  Model simulations also replicates power law distribution of firm sizes and Laplace distribution of firms' growth rates. 
  3. Econometric Measures of Systemic Risk in the Finance and Insurance Sectors-This paper by Billio et al suggests some possible practical applications of the network approach to systemic risk analysis.

Wednesday, August 18, 2010

The Hidden Hazards of Adaptive Behavior...

James passed me this interesting paper on the stability of multivariate systems where agents use adaptive behavior via email.  I did a quick read...heavy on the maths (although I think it is mostly just multivariate calculus and linear algebra). They also went all out on the notation...I haven't seen some of those symbols outside of formal advanced maths texts. It would take quite a bit of work for me to fully grasp the paper as I would need to follow through on the calculations etc. Although plowing through the maths would be a good refresher...

I think his (i.e., James') characterization of the paper in the email is pretty much on target. They seem to formally develop general conditions under which multivariate systems with adaptive expectations are not stable. They find that for the most part, such systems are not stable.  And they stress that their results provide further evidence that equilibrium stability results from models where homogeneous agents are using adaptive behavior (or that are otherwise one-dimensional) should not be generalized to high dimensional or heterogeneous agent models where agents are using adaptive behavior.  The study of multivariate (and heterogeneous agent) systems, would seem to be a study in disequilibrium behavior...

Their results support the other research on multivariate and complex adaptive systems that I have read. From my reading of the literature, multivariate systems (including heterogeneous agent systems), generally speaking, are not stable.  At least in the sense that it is rare that such complex systems settle down to some static equilibrium.  On the other hand many multivariate and complex adaptive systems do exhibit endogenous self-organizing behavior (which I like to think of as a type of stable disequilibrium behavior...although this may not be the best choice of words to capture the phenomenon), punctuated equilibrium dynamics, etc.

The more I learn about economics, the more I am becoming convinced that economics is not an equilibrium science.  Economics is fundamentally a science of disequilibrium behavior.  I will go out on a limb here and say that perhaps one of the reasons that economics, particularly macroeconomics, has struggled so much is because we as economists are trying to force our (for the most part) linear equilibrium models to describe a non-linear disequilibrium world...

There is also the (I'd like to think small) possibility that I am cocooned in a world of complex adaptive systems, and am suffering from a massive case of confirmation bias...