A class of nonlinear second order difference equations from macroeconomics