23. Kesten Processes and Firm Dynamics#

In addition to what’s in Anaconda, this lecture will need the following libraries:

!pip install quantecon
!pip install --upgrade yfinance
Hide code cell output
Requirement already satisfied: quantecon in /opt/conda/envs/quantecon/lib/python3.11/site-packages (0.7.2)
Requirement already satisfied: numba>=0.49.0 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from quantecon) (0.59.0)
Requirement already satisfied: numpy>=1.17.0 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from quantecon) (1.26.4)
Requirement already satisfied: requests in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from quantecon) (2.31.0)
Requirement already satisfied: scipy>=1.5.0 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from quantecon) (1.11.4)
Requirement already satisfied: sympy in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from quantecon) (1.12)
Requirement already satisfied: llvmlite<0.43,>=0.42.0dev0 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from numba>=0.49.0->quantecon) (0.42.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests->quantecon) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests->quantecon) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests->quantecon) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests->quantecon) (2024.2.2)
Requirement already satisfied: mpmath>=0.19 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from sympy->quantecon) (1.3.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Collecting yfinance
  Downloading yfinance-0.2.38-py2.py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: pandas>=1.3.0 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from yfinance) (2.1.4)
Requirement already satisfied: numpy>=1.16.5 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from yfinance) (1.26.4)
Requirement already satisfied: requests>=2.31 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from yfinance) (2.31.0)
Collecting multitasking>=0.0.7 (from yfinance)
  Downloading multitasking-0.0.11-py3-none-any.whl.metadata (5.5 kB)
Requirement already satisfied: lxml>=4.9.1 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from yfinance) (4.9.3)
Requirement already satisfied: appdirs>=1.4.4 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from yfinance) (1.4.4)
Requirement already satisfied: pytz>=2022.5 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from yfinance) (2024.1)
Collecting frozendict>=2.3.4 (from yfinance)
  Downloading frozendict-2.4.2.tar.gz (315 kB)
?25l     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/315.3 kB ? eta -:--:--
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 315.3/315.3 kB 9.7 MB/s eta 0:00:00
  Installing build dependencies ... ?25l-
 \ done
?25h  Getting requirements to build wheel ... ?25l- done
?25h  Preparing metadata (pyproject.toml) ... ?25l-
?25hCollecting peewee>=3.16.2 (from yfinance)
  Downloading peewee-3.17.3.tar.gz (3.0 MB)
?25l     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/3.0 MB ? eta -:--:--
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ 2.9/3.0 MB 110.4 MB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 72.8 MB/s eta 0:00:00
  Installing build dependencies ... ?25l-
 / done
?25h  Getting requirements to build wheel ... ?25l-
?25h  Preparing metadata (pyproject.toml) ... ?25l-
?25hRequirement already satisfied: beautifulsoup4>=4.11.1 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from yfinance) (4.12.2)
Collecting html5lib>=1.1 (from yfinance)
  Downloading html5lib-1.1-py2.py3-none-any.whl.metadata (16 kB)
Requirement already satisfied: soupsieve>1.2 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from beautifulsoup4>=4.11.1->yfinance) (2.5)
Requirement already satisfied: six>=1.9 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from html5lib>=1.1->yfinance) (1.16.0)
Requirement already satisfied: webencodings in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from html5lib>=1.1->yfinance) (0.5.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from pandas>=1.3.0->yfinance) (2.8.2)
Requirement already satisfied: tzdata>=2022.1 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from pandas>=1.3.0->yfinance) (2023.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests>=2.31->yfinance) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests>=2.31->yfinance) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests>=2.31->yfinance) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/quantecon/lib/python3.11/site-packages (from requests>=2.31->yfinance) (2024.2.2)
Downloading yfinance-0.2.38-py2.py3-none-any.whl (72 kB)
?25l   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/73.0 kB ? eta -:--:--
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.0/73.0 kB 9.5 MB/s eta 0:00:00
?25hDownloading html5lib-1.1-py2.py3-none-any.whl (112 kB)
?25l   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/112.2 kB ? eta -:--:--
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 112.2/112.2 kB 15.0 MB/s eta 0:00:00
?25hDownloading multitasking-0.0.11-py3-none-any.whl (8.5 kB)
Building wheels for collected packages: frozendict, peewee
  Building wheel for frozendict (pyproject.toml) ... ?25l-
?25h  Created wheel for frozendict: filename=frozendict-2.4.2-cp311-cp311-linux_x86_64.whl size=15500 sha256=61e93352832d30737aedc63903a5c8efcbadf6a9357ed3372168c1fb3ff1ec37
  Stored in directory: /github/home/.cache/pip/wheels/b6/d6/b5/da9ad65b3c11d2d2f3245b0b2476231dc58a2a91768c5ec755
  Building wheel for peewee (pyproject.toml) ... ?25l-
?25h  Created wheel for peewee: filename=peewee-3.17.3-cp311-cp311-linux_x86_64.whl size=274287 sha256=ef1de29d24f3a126af1918981932b129446f80d4fc6c4f277158228f86edeabc
  Stored in directory: /github/home/.cache/pip/wheels/3e/3d/30/a54ad8c2307aa653f234a6f651ab12fbc5cfbb3f383145ab6a
Successfully built frozendict peewee
Installing collected packages: peewee, multitasking, html5lib, frozendict, yfinance
Successfully installed frozendict-2.4.2 html5lib-1.1 multitasking-0.0.11 peewee-3.17.3 yfinance-0.2.38
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

23.1. Overview#

Previously we learned about linear scalar-valued stochastic processes (AR(1) models).

Now we generalize these linear models slightly by allowing the multiplicative coefficient to be stochastic.

Such processes are known as Kesten processes after German–American mathematician Harry Kesten (1931–2019)

Although simple to write down, Kesten processes are interesting for at least two reasons:

  1. A number of significant economic processes are or can be described as Kesten processes.

  2. Kesten processes generate interesting dynamics, including, in some cases, heavy-tailed cross-sectional distributions.

We will discuss these issues as we go along.

Let’s start with some imports:

import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5)  #set default figure size
import numpy as np
import quantecon as qe

The following two lines are only added to avoid a FutureWarning caused by compatibility issues between pandas and matplotlib.

from pandas.plotting import register_matplotlib_converters

Additional technical background related to this lecture can be found in the monograph of [Buraczewski et al., 2016].

23.2. Kesten Processes#

A Kesten process is a stochastic process of the form

(23.1)#\[X_{t+1} = a_{t+1} X_t + \eta_{t+1}\]

where \(\{a_t\}_{t \geq 1}\) and \(\{\eta_t\}_{t \geq 1}\) are IID sequences.

We are interested in the dynamics of \(\{X_t\}_{t \geq 0}\) when \(X_0\) is given.

We will focus on the nonnegative scalar case, where \(X_t\) takes values in \(\mathbb R_+\).

In particular, we will assume that

  • the initial condition \(X_0\) is nonnegative,

  • \(\{a_t\}_{t \geq 1}\) is a nonnegative IID stochastic process and

  • \(\{\eta_t\}_{t \geq 1}\) is another nonnegative IID stochastic process, independent of the first.

23.2.1. Example: GARCH Volatility#

The GARCH model is common in financial applications, where time series such as asset returns exhibit time varying volatility.

For example, consider the following plot of daily returns on the Nasdaq Composite Index for the period 1st January 2006 to 1st November 2019.

import yfinance as yf

s = yf.download('^IXIC', '2006-1-1', '2019-11-1')['Adj Close']

r = s.pct_change()

fig, ax = plt.subplots()

ax.plot(r, alpha=0.7)

ax.set_ylabel('returns', fontsize=12)
ax.set_xlabel('date', fontsize=12)

[*********************100%%**********************]  1 of 1 completed


Notice how the series exhibits bursts of volatility (high variance) and then settles down again.

GARCH models can replicate this feature.

The GARCH(1, 1) volatility process takes the form

(23.2)#\[\sigma_{t+1}^2 = \alpha_0 + \sigma_t^2 (\alpha_1 \xi_{t+1}^2 + \beta)\]

where \(\{\xi_t\}\) is IID with \(\mathbb E \xi_t^2 = 1\) and all parameters are positive.

Returns on a given asset are then modeled as

(23.3)#\[r_t = \sigma_t \zeta_t\]

where \(\{\zeta_t\}\) is again IID and independent of \(\{\xi_t\}\).

The volatility sequence \(\{\sigma_t^2 \}\), which drives the dynamics of returns, is a Kesten process.

23.2.2. Example: Wealth Dynamics#

Suppose that a given household saves a fixed fraction \(s\) of its current wealth in every period.

The household earns labor income \(y_t\) at the start of time \(t\).

Wealth then evolves according to

(23.4)#\[w_{t+1} = R_{t+1} s w_t + y_{t+1}\]

where \(\{R_t\}\) is the gross rate of return on assets.

If \(\{R_t\}\) and \(\{y_t\}\) are both IID, then (23.4) is a Kesten process.

23.2.3. Stationarity#

In earlier lectures, such as the one on AR(1) processes, we introduced the notion of a stationary distribution.

In the present context, we can define a stationary distribution as follows:

The distribution \(F^*\) on \(\mathbb R\) is called stationary for the Kesten process (23.1) if

(23.5)#\[X_t \sim F^* \quad \implies \quad a_{t+1} X_t + \eta_{t+1} \sim F^*\]

In other words, if the current state \(X_t\) has distribution \(F^*\), then so does the next period state \(X_{t+1}\).

We can write this alternatively as

(23.6)#\[F^*(y) = \int \mathbb P\{ a_{t+1} x + \eta_{t+1} \leq y\} F^*(dx) \quad \text{for all } y \geq 0.\]

The left hand side is the distribution of the next period state when the current state is drawn from \(F^*\).

The equality in (23.6) states that this distribution is unchanged.

23.2.4. Cross-Sectional Interpretation#

There is an important cross-sectional interpretation of stationary distributions, discussed previously but worth repeating here.

Suppose, for example, that we are interested in the wealth distribution — that is, the current distribution of wealth across households in a given country.

Suppose further that

  • the wealth of each household evolves independently according to (23.4),

  • \(F^*\) is a stationary distribution for this stochastic process and

  • there are many households.

Then \(F^*\) is a steady state for the cross-sectional wealth distribution in this country.

In other words, if \(F^*\) is the current wealth distribution then it will remain so in subsequent periods, ceteris paribus.

To see this, suppose that \(F^*\) is the current wealth distribution.

What is the fraction of households with wealth less than \(y\) next period?

To obtain this, we sum the probability that wealth is less than \(y\) tomorrow, given that current wealth is \(w\), weighted by the fraction of households with wealth \(w\).

Noting that the fraction of households with wealth in interval \(dw\) is \(F^*(dw)\), we get

\[ \int \mathbb P\{ R_{t+1} s w + y_{t+1} \leq y\} F^*(dw) \]

By the definition of stationarity and the assumption that \(F^*\) is stationary for the wealth process, this is just \(F^*(y)\).

Hence the fraction of households with wealth in \([0, y]\) is the same next period as it is this period.

Since \(y\) was chosen arbitrarily, the distribution is unchanged.

23.2.5. Conditions for Stationarity#

The Kesten process \(X_{t+1} = a_{t+1} X_t + \eta_{t+1}\) does not always have a stationary distribution.

For example, if \(a_t \equiv \eta_t \equiv 1\) for all \(t\), then \(X_t = X_0 + t\), which diverges to infinity.

To prevent this kind of divergence, we require that \(\{a_t\}\) is strictly less than 1 most of the time.

In particular, if

(23.7)#\[\mathbb E \ln a_t < 0 \quad \text{and} \quad \mathbb E \eta_t < \infty\]

then a unique stationary distribution exists on \(\mathbb R_+\).

As one application of this result, we see that the wealth process (23.4) will have a unique stationary distribution whenever labor income has finite mean and \(\mathbb E \ln R_t + \ln s < 0\).

23.3. Heavy Tails#

Under certain conditions, the stationary distribution of a Kesten process has a Pareto tail.

(See our earlier lecture on heavy-tailed distributions for background.)

This fact is significant for economics because of the prevalence of Pareto-tailed distributions.

23.3.1. The Kesten–Goldie Theorem#

To state the conditions under which the stationary distribution of a Kesten process has a Pareto tail, we first recall that a random variable is called nonarithmetic if its distribution is not concentrated on \(\{\dots, -2t, -t, 0, t, 2t, \ldots \}\) for any \(t \geq 0\).

For example, any random variable with a density is nonarithmetic.

The famous Kesten–Goldie Theorem (see, e.g., [Buraczewski et al., 2016], theorem 2.4.4) states that if

  1. the stationarity conditions in (23.7) hold,

  2. the random variable \(a_t\) is positive with probability one and nonarithmetic,

  3. \(\mathbb P\{a_t x + \eta_t = x\} < 1\) for all \(x \in \mathbb R_+\) and

  4. there exists a positive constant \(\alpha\) such that

\[ \mathbb E a_t^\alpha = 1, \quad \mathbb E \eta_t^\alpha < \infty, \quad \text{and} \quad \mathbb E [a_t^{\alpha+1} ] < \infty \]

then the stationary distribution of the Kesten process has a Pareto tail with tail index \(\alpha\).

More precisely, if \(F^*\) is the unique stationary distribution and \(X^* \sim F^*\), then

\[ \lim_{x \to \infty} x^\alpha \mathbb P\{X^* > x\} = c \]

for some positive constant \(c\).

23.3.2. Intuition#

Later we will illustrate the Kesten–Goldie Theorem using rank-size plots.

Prior to doing so, we can give the following intuition for the conditions.

Two important conditions are that \(\mathbb E \ln a_t < 0\), so the model is stationary, and \(\mathbb E a_t^\alpha = 1\) for some \(\alpha > 0\).

The first condition implies that the distribution of \(a_t\) has a large amount of probability mass below 1.

The second condition implies that the distribution of \(a_t\) has at least some probability mass at or above 1.

The first condition gives us existence of the stationary condition.

The second condition means that the current state can be expanded by \(a_t\).

If this occurs for several concurrent periods, the effects compound each other, since \(a_t\) is multiplicative.

This leads to spikes in the time series, which fill out the extreme right hand tail of the distribution.

The spikes in the time series are visible in the following simulation, which generates of 10 paths when \(a_t\) and \(b_t\) are lognormal.

μ = -0.5
σ = 1.0

def kesten_ts(ts_length=100):
    x = np.zeros(ts_length)
    for t in range(ts_length-1):
        a = np.exp(μ + σ * np.random.randn())
        b = np.exp(np.random.randn())
        x[t+1] = a * x[t] + b
    return x

fig, ax = plt.subplots()

num_paths = 10

for i in range(num_paths):

ax.set(xlabel='time', ylabel='$X_t$')

23.4. Application: Firm Dynamics#

As noted in our lecture on heavy tails, for common measures of firm size such as revenue or employment, the US firm size distribution exhibits a Pareto tail (see, e.g., [Axtell, 2001], [Gabaix, 2016]).

Let us try to explain this rather striking fact using the Kesten–Goldie Theorem.

23.4.1. Gibrat’s Law#

It was postulated many years ago by Robert Gibrat [Gibrat, 1931] that firm size evolves according to a simple rule whereby size next period is proportional to current size.

This is now known as Gibrat’s law of proportional growth.

We can express this idea by stating that a suitably defined measure \(s_t\) of firm size obeys

(23.8)#\[\frac{s_{t+1}}{s_t} = a_{t+1}\]

for some positive IID sequence \(\{a_t\}\).

One implication of Gibrat’s law is that the growth rate of individual firms does not depend on their size.

However, over the last few decades, research contradicting Gibrat’s law has accumulated in the literature.

For example, it is commonly found that, on average,

  1. small firms grow faster than large firms (see, e.g., [Evans, 1987] and [Hall, 1987]) and

  2. the growth rate of small firms is more volatile than that of large firms [Dunne et al., 1989].

On the other hand, Gibrat’s law is generally found to be a reasonable approximation for large firms [Evans, 1987].

We can accommodate these empirical findings by modifying (23.8) to

(23.9)#\[s_{t+1} = a_{t+1} s_t + b_{t+1}\]

where \(\{a_t\}\) and \(\{b_t\}\) are both IID and independent of each other.

In the exercises you are asked to show that (23.9) is more consistent with the empirical findings presented above than Gibrat’s law in (23.8).

23.4.2. Heavy Tails#

So what has this to do with Pareto tails?

The answer is that (23.9) is a Kesten process.

If the conditions of the Kesten–Goldie Theorem are satisfied, then the firm size distribution is predicted to have heavy tails — which is exactly what we see in the data.

In the exercises below we explore this idea further, generalizing the firm size dynamics and examining the corresponding rank-size plots.

We also try to illustrate why the Pareto tail finding is significant for quantitative analysis.

23.5. Exercises#

Exercise 23.1

Simulate and plot 15 years of daily returns (consider each year as having 250 working days) using the GARCH(1, 1) process in (23.2)(23.3).

Take \(\xi_t\) and \(\zeta_t\) to be independent and standard normal.

Set \(\alpha_0 = 0.00001, \alpha_1 = 0.1, \beta = 0.9\) and \(\sigma_0 = 0\).

Compare visually with the Nasdaq Composite Index returns shown above.

While the time path differs, you should see bursts of high volatility.

Exercise 23.2

In our discussion of firm dynamics, it was claimed that (23.9) is more consistent with the empirical literature than Gibrat’s law in (23.8).

(The empirical literature was reviewed immediately above (23.9).)

In what sense is this true (or false)?

Exercise 23.3

Consider an arbitrary Kesten process as given in (23.1).

Suppose that \(\{a_t\}\) is lognormal with parameters \((\mu, \sigma)\).

In other words, each \(a_t\) has the same distribution as \(\exp(\mu + \sigma Z)\) when \(Z\) is standard normal.

Suppose further that \(\mathbb E \eta_t^r < \infty\) for every \(r > 0\), as would be the case if, say, \(\eta_t\) is also lognormal.

Show that the conditions of the Kesten–Goldie theorem are satisfied if and only if \(\mu < 0\).

Obtain the value of \(\alpha\) that makes the Kesten–Goldie conditions hold.

Exercise 23.4

One unrealistic aspect of the firm dynamics specified in (23.9) is that it ignores entry and exit.

In any given period and in any given market, we observe significant numbers of firms entering and exiting the market.

Empirical discussion of this can be found in a famous paper by Hugo Hopenhayn [Hopenhayn, 1992].

In the same paper, Hopenhayn builds a model of entry and exit that incorporates profit maximization by firms and market clearing quantities, wages and prices.

In his model, a stationary equilibrium occurs when the number of entrants equals the number of exiting firms.

In this setting, firm dynamics can be expressed as

(23.11)#\[s_{t+1} = e_{t+1} \mathbb{1}\{s_t < \bar s\} + (a_{t+1} s_t + b_{t+1}) \mathbb{1}\{s_t \geq \bar s\}\]


  • the state variable \(s_t\) represents productivity (which is a proxy for output and hence firm size),

  • the IID sequence \(\{ e_t \}\) is thought of as a productivity draw for a new entrant and

  • the variable \(\bar s\) is a threshold value that we take as given, although it is determined endogenously in Hopenhayn’s model.

The idea behind (23.11) is that firms stay in the market as long as their productivity \(s_t\) remains at or above \(\bar s\).

  • In this case, their productivity updates according to (23.9).

Firms choose to exit when their productivity \(s_t\) falls below \(\bar s\).

  • In this case, they are replaced by a new firm with productivity \(e_{t+1}\).

What can we say about dynamics?

Although (23.11) is not a Kesten process, it does update in the same way as a Kesten process when \(s_t\) is large.

So perhaps its stationary distribution still has Pareto tails?

Your task is to investigate this question via simulation and rank-size plots.

The approach will be to

  1. generate \(M\) draws of \(s_T\) when \(M\) and \(T\) are large and

  2. plot the largest 1,000 of the resulting draws in a rank-size plot.

(The distribution of \(s_T\) will be close to the stationary distribution when \(T\) is large.)

In the simulation, assume that

  • each of \(a_t, b_t\) and \(e_t\) is lognormal,

  • the parameters are

μ_a = -0.5        # location parameter for a
σ_a = 0.1         # scale parameter for a
μ_b = 0.0         # location parameter for b
σ_b = 0.5         # scale parameter for b
μ_e = 0.0         # location parameter for e
σ_e = 0.5         # scale parameter for e
s_bar = 1.0       # threshold
T = 500           # sampling date
M = 1_000_000     # number of firms
s_init = 1.0      # initial condition for each firm