A Behavioral Model of the Credit Cycle