ECONOMICS 916 WINTER 2007
ADVANCED TOPICS IN APPLIED MACROECONOMICS II
C. FERRALL

Assignment 1.0 (version 2)

For the exercises below, submit your code, output and a brief report of your results by e-mail before Tuesday, February 6.

  1. Preparation
  2. Download cf_cd2.ox, run_cd.ox and parameters.ox. The first file defines a class called cobb_douglas_agent (see oxsyntax.html#ox_syntax_RefClasses). It differs from the first version by using the parameters class for the utility maximization. Rename the file and the class with your initials (that is, change cf). Run the simple run_cd.ox that creates a Cobb-Douglas household, computes the Marshallian demand for a single budget and graphs the result (for the console version of Ox, the graph is saved in c.eps (an encapsulated Postscript file).

  3. Analysis
  4. Conduct an analysis of the efficiency of MaxBFGS, MaxSimplex, and MaxSA in computing Marshallian demand. Vary the number of dimensions, the starting values and the exponents..

  5. Programming
  6. Complete the code for cobb_douglas_agent::foc and ext_foc to compute the first order conditions. Satisfy the requirements to send ext_foc for SolveNLE. Then conduct a similar analysis of performance of the system of equations (using different algorithms).

  7. Extensions
  8. Carry out at least one of these extensions. Do as many as you want.
    1. Investigate the use of MaxSQP and Gauss-Seidel

      For MaxSQP you will have to add a function to evaluate the budget constraint in the form required like cfunc_gt0(const avF, const vP) in the Ox documentation (also see Judd p. 125). Submit your code and your test runs. Briefly describe the performance relative to the MaxBFGS and using first order conditions. Document your code so that I can understand it. Also, compare the use of Gauss-Seidel to Broyden (see Judd p. 161).

    2. Create a CES_agent class

      Copy your code to a new file. Working from there create a new class, CES_agent to handle CES preferences/technology instead of Cobb-Douglas. Then create derived classes for Leontief , Cobb-Douglas, and linear agents that use the base CES_agent class but specialize so that fewer parameters are necessary (see oxsyntax.html#ox_syntax_RefDerClass). Confirm that your derived class for Cobb-Douglas based on CES gives the same results as cobb_douglas_agent.

    3. Create a life_cycle class.

      Copy either cobb_douglas_agent or CES_agent to a new a new file. Create a new class, life_cycle to handle discounted utility over a finite horizon T. Restrict the class to have only two commodities, leisure time and consumption. The price of consumption is normalized to 1 and the price of leisure (the wage) is given by a T x 1 vector. There is also a vector of interest rates. Choice is subject to a time endowment each period (perhaps normalize the endowment to 1). And there is a no-borrowing constraint. Let A0 denote the agents initial assets. Write code that solves the system of Euler equations with occasionally binding constraints.

    4. Create a cd_exchange_economy class

      Create a new class called cd_economy which takes as input an arrays, the finite set of Cobb-Douglas agents in an exchange economy. Each element of the agents have a different vector of coefficients over the same commodity space. The array also specifies the population proportion of each type of agent and the endowment vector for each type. Note: cd_economy is not derived from cobb_douglas_agent because an economy is not a type of agent. Instead, your economy class will at creation generate arrays of cobb_douglas_agent objects. Your code would include a member (perhaps called walrasian_equilibrium) that computes an equilibrium price vector by finding a zero of the net demand vector calling Marshallian demand for each type.

    5. DYI

      Propose your own assignment of this type which would show creation of classes and implementation of a further aspect of basic optimization and equilibrium.