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)

Saturday, January 29, 2011

Calculating the Walrasian Auctioneer...

Attention conservation notice: Longish post on the details of a stochastic speculative pricing model from Economic Dynamics.  It is my hope that working through this model will help me find a way forward in implementing a computational solution to the Kiyotaki-Moore (1997) model which will inform my extension of that model.
Suppose that we live in world where there is a single commodity called wheat, whose price at date t is pt.  Due to global warming, weather patterns in this world are quite volatile and as a result the harvest of wheat each period (i.e., production of wheat), Wt, is IID random and drawn from a common density function φ.  

Harvests take values in S≡[a,∞), where a>0.  The demand for wheat is made up by two groups: gatherers, and farmers.  Gatherers' quantity demanded is QG=D(p), where p is the price of fruit.  It is assumed that the inverse demand function, D-1(QG)=p(QG), exists, is strictly decreasing and continuous, and satisfies p(QG)→∞, as QG→0.

Farmers are risk neutral and have a special technology, called a barn, where they can store wheat between periods.  If farmers purchase It units of wheat on date t, then they will be left with αIt, where α ∈ (0,1), next period.  Risk-free interest rate is taken to be zero, so we can write the farmers' expected profits on It units of wheat as:
Et(pt+1)αIt - ptIt = (αEt(pt+1) - pt)It
No-arbitrage requires that :
αEt(pt+1) - pt ≤ 0     (1)

There is also a logical constraint that tells us that if our farmers are maximizing expected profits, then if
αEt(pt+1) - pt < 0 implies that It = 0   (2)
 Finally, market clearing condition requires that supply of wheat equal demand for wheat.  Supply of wheat, Xt, is sum of carryover from farmers, αIt-1, and the current harvest Wt, while demand is D(pt) + It. Thus we get:
αIt-1 + Wt = Xt= D(pt) + It     (3) 
Take the initial condition for supply of wheat, X0 ∈ S as given.

The question now becomes, how does one construct a system (It, pt, Xt)t ≥ 0 for investment, prices, and supply of wheat that satisfies (1-3)?  The idea is to find a price function p:S→(0,∞) that depends only on the current state Xt (i.e., pt=p(Xt) for every t).  The vector  (It, pt, Xt)t ≥ 0 for investment, prices, and supply of wheat would then evolve according to:
pt=p(Xt), It = Xt - D(pt), and Xt+1 = αIt + Wt+1      (4)
For a given initial condition for supply of wheat, X0 ∈ S and a exogenous shock process (Wt)t ≥ 1, the system (4) determines the time path of our vector (It, pt, Xt)t ≥ 0 as a sequence of random variables.   The idea then is to find a pricing function p such that (1) and (2) hold for the system (4).  

I skip over the theory related to solving this system (the solution makes heavy use of Banach's fixed point theorem, consult Economic Dynamics for the details), and jump straight to the numerical solution.

Here is a plot of the pricing function when gatherers' inverse demand function is assumed to follow D-1(QG)=p(QG)=1/QG and the random harvests Wt = a + cBt where the Bt are drawn from a beta distribution Beta(5,5).
This figure reproduces Figure 6.13 from Economic Dynamics.  Once the pricing function has been calculated, it can be used to define a stochastic dynamical system as follows:
  Xt+1 = αI(Xt)+ Wt+1
where I(x) = x - D(P*(x)).

I have simulated several trajectories, and marginal densities from this stochastic process.
In addition to marginal densities, I also plotted the density of the random harvest.  The fact that the marginal densities of the supply of wheat converge to the density of the harvest process indicates that the farmers (who are wheat speculators) do not have any impact on the long-run supply of wheat.
For fun, I also reproduced the above analysis assuming that the harvest follows a Pareto distribution with α=2 (location and scale parameters are the same as those of the Beta distribution above).  I find the plots amusing...
Note that, in this case, the marginal densities seem to converge...but not to the density of the harvest process.  What does this mean?  Well for this parametrization the Pareto distribution has a well defined mean, which implies that there is an "average" harvest (about 10 units in this case), but the variance is infinite!  Thus while tomorrows harvest is likely to be close to 10, there is also a non-negligible probability that it could be 10,000.  The mean is very much influenced by these large harvests.  The median of the distribution, however, is about 7.5.  It is almost as if the speculators, because they wake up to below average harvests on most mornings, believe that the best thing to do is try to store wheat and sell it next period.

Any other interpretations?  The code is posted to my repository (you will want cpdynam.py and pSolve.py amongst other dependencies).

For those of you following my research...I am playing around with the idea of using the above methods to try to solve for the price of land in the Credit Cycles model.  The first thing I will need to endogenize the production side of the above economy.  Any strong beliefs about whether this would be a useful way to proceed?

No comments:

Post a Comment