## 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?