A Model of Macroeconomic Activity: Volume I: The Theoretical Model