Statistical Mechanics of Money

Manipulate[
Module[{moneyDist=moneyDistHistory[[Round[time]]],truncEntropyHistory=Take[entropyHistory,Round[time]]},
GraphicsGrid[{{Histogram[moneyDist,ImageSize->250,PlotLabel->"money distribution",AxesLabel->{"money","number of agents"},PlotRange->{0,500}],ListPlot[truncEntropyHistory,Joined->True,PlotRange->Full,AxesLabel->{"time","entropy"}]}},ImageSize->{600,300}]
],
{time,1,50,1},
Initialization:>{
(* Exchange random amount of money between two randomly selected agents *)randomExchange[agents_List,dM_Real]:=Module[{newAgents=agents,a1=RandomInteger[Length[agents]-1]+1,a2=RandomInteger[Length[agents]-1]+1,money},
money=Random[]*dM;
If[newAgents[[a1]]≥money,
newAgents[[a1]]-=money;
newAgents[[a2]]+=money;
];
newAgents
];
(* Calculate entropy of money distribution *)
calcEntropy[agents_List]:=Module[{bins},
bins=BinCounts[agents,{0,Ceiling[Total[agents]],1}];
bins=bins/Length[agents];
bins=DeleteCases[bins,0];
-bins.Log[bins]
];
(* Create an initial state of the economy. *)
initSimulation[numAgents_Integer,numEconomies_Integer,initialMoneyEndowment_Real]:=
Table[Table[initialMoneyEndowment,{numAgents}],{numEconomies}];
(* Run the simulation for specified time steps. *)
runSimulation[economyList_List,dM_Real,time_Integer]:=Module[{newEconomyList=economyList},
Do[newEconomyList=Map[(randomExchange[#,dM])&,newEconomyList];,{time}];
newEconomyList
];
(* Create simulation data *)
makeData[numAgents_Integer,numEconomies_Integer,initialMoneyEndowment_Real,numSamples_Integer,stepSize_Integer]:=Module[{economyList=initSimulation[numAgents,numEconomies,initialMoneyEndowment],entropyHistory={},moneyDistHistory={},incomeDistHistory={}},
Do[
moneyDistHistory=Append[moneyDistHistory,Flatten[economyList]];
entropyHistory=Append[entropyHistory,(Map[calcEntropy,economyList]/Length[economyList])[[1]]];
economyList=runSimulation[economyList,initialMoneyEndowment,stepSize];,
{numSamples}
];
{moneyDistHistory,entropyHistory}
];
{moneyDistHistory,entropyHistory}=makeData[25,20,100.0,50,5];
}
]

CAPTION

The empirical distribution of the majority of people's wealth is consistent with an exponential (Boltzmann-Gibbs) distribution. This outcome can be replicated by an abstract agent-based simulation that models the exchange of money for goods in market economies. In this simulation, (i) total money is conserved and (ii) a random amount of money is transferred from one randomly selected agent to another ad infinitum. The first plot tracks the instantaneous money distribution (a simple proxy for wealth). The money distribution is initially equitable but rapidly converges to the highly unequal exponential distribution, at which point the economy enters statistical equilibrium. The second plot tracks the entropy of the money distribution, which increases to a maximum. The exponential distribution is the maximum entropy distribution under the constraint of money conservation. So market exchange between large numbers of independent agents is a mechanism that produces the "most disorderly" distribution of wealth subject to a simple conservation constraint.

DETAILS

In this simulation, a random amount of money in the range [0, m] is transferred from one randomly selected agent to another; if the agent has insufficient funds, the exchange does not take place. To produce smoother results, independent economies are simulated in parallel. The graphs summarize the income distribution and entropy of economies, each with 25 agents. This model of money distribution was first described in a classic paper of the econophysics movement [1].

The complete wealth distribution is characterized by an exponential body (approximately 80% of the population) coupled to a power-law tail (a Pareto distribution, accounting for the wealthiest 20% of the population). A similar agent-based approach, described in [2], replicates the complete wealth distribution, in addition to other empirical regularities of capitalist economies, such as the power-law of firm sizes, the Laplace distribution of firm and GDP growth, etc. These results, and others, suggest that capitalist economies approximate a state of statistical equilibrium.

[1] A. Dragulescu and V. M. Yakovenko, "Statistical Mechanics of Money," The European Physical Journal B, 17(4), 2000 pp. 723–729.

[2] I. Wright, "The Social Architecture of Capitalism," Physica A: Statistical Mechanics and its Applications, 346(3-4), 2005 pp. 589–620.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Statistical Mechanics of Money" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/StatisticalMechanicsOfMoney/

Contributed by: Ian Wright

After work by: A. A. Dragulescu, V. M. Yakovenko, and Justin Chen

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »