This reproduces Figure 2 in "Diagnostic Expectations and Credit Cycles" by Pedro Bordalo, Nicola Gennaioli, Andrei Shleifer (2015). More information here.
lpuettmann/diagnostic-expectations
Reproduce Figure 2 in "Diagnostic Expectations and Credit Cycles" by Pedro Bordalo, Nicola Gennaioli and Andrei Shleifer (2015)
MATLAB