This code that implements the RLS method and solves the Bertrand pricing and investment game in the papers "Recursive Lexicographical Search: Finding all Markov Perfect Equilibria of Finite State Directional Dynamic Games" (Review of Economic Studies, 2015) and "The Dynamics of Bertrand Price Competition with Cost-Reducing Investments" by Fedor Iskhakov, Bertel Schjerning and John Rust.
Any of the run_leapfrog_* scripts will run various versions of the model.
To run this code Matlab has to be properly configured with C compiler (run mex -setup) and refer to http://se.mathworks.com/support/compilers/R2015b/index.html?refresh=true (Matlab R2015b)