# Matlab Programs for Last-In First-Out Oligopoly Dynamics

## by Jaap H. Abbring and Jeffrey R. Campbell

The links below lead to html versions of the programs.

## Building Blocks

These programs are the fundamental procedures that underlie the entire effort. Although typically such procedures would be encapsulated within a function, we have written them as a stand-alone programs. Each of them looks for the existence of a variable designated to pass arguments. (For example, `approximate.m` looks for the structure `approximateARG`.) If this variable does not exist, then it uses default values to carry out an example of its task. These programs also typically produce graphical or text output if their designated variable does not exist. This allows us to check that they are performing properly before using them.

approximate.m
  This program calculates a set of mixing coefficients over uniform distributions to approximate a given symmetric distribution.
markov.m
  This program creates the support and transition matrix of a Markov chain approximating an AR(1) reflected off of the boundaries of its support.
bellman.m
  This program is the heart of the enterprise. It uses Bellman-equation iteration as described in the text to calculate the LIFO equilibrium value functions.
thresholds.m
  This program calculates the equilibrium entry and exit thresholds.

## Quantity Calculations

With the equilibrium in hand, the code in these programs calculates the model's ergodic distribution and related observable quantities.

ergodic.m
  This program calculates the LIFO equilibrium's ergodic distribution.
probit.m
  This program calculates Section 4.3's Probit-based static entry thresholds from this ergodic distribution. It uses the optimization toolbox to maximize population likelihood functions.

## Example Files

These programs calculate equilibria for the papers' examples.

pencil.m
  This calculates the equilibrium for Section 2.2's pencil-and-paper example. Yes, it can really be done with pencil and paper, but those tools are less reliable than Matlab.
nothreshold.m
  This calculates the equilibrium for Section 3's counterexample to the assertion that stochastic dominance suffices for all firms to use threshold rules.

## Experiment Files

These are the programs that run the various experiments reported in the papers.

experimentI.m
  This calculates the entry and exit thresholds reported in Table I.
experimentII.m
  This calculates the Probit-based static entry thresholds and their implications for the toughness of competition in Table II.

## Output Utility Files

Matlab creates the tables and the numbers referenced in the text, so no human hand can introduce an error. These files accomplish this.

latextableI.m
  This program creates the table of entry and exit thresholds (Table I).
latextableII.m
  This program creates the table of Probit-based static entry thresholds and their implications for the toughness of competition (Table II).