Homeworks for Econ 8185 Quantitative Macro, Fall of 2012


There may be preliminary versions of future homeworks in this page. I may change them until the day I state in the course homepage that the relevant homework batch is ready.
  • First Homework batch. Due Wed September 19th. Name them sept_19_h1, sept_19_h2 and so on.
    1. Data manipulation.

      1.A Fetch and plot US quarterly GDP Investment plus durables plus net exports, non-durables plus services, and aggregate hours both from CPS and from the firm survey (see Cooley chapter 1, page 30). Store it in pdf, eps, and emf or wmf formats.

      1.B HP filter and plot US quarterly (log) GDP. Store it in postcript or pdf. Compute the same table as in the Cooley book for those 4 variables using data up to 2003:4 or later.

      1.C Calculate a linear trend and decompose log GDP in the linear trend the hp trend and the hp residual.

      1.D Plot the growth rates together with the hp residual and comment the differences.

      1.E Compute a VAR of those 4 variables and plot the impulse responses. Make sure that you explicitly state what are the identifying assumptions that you make.

    2. Interpolation.

      Write a routine that linearly interpolates. Apply it by storing the value of exp (x) between 0 and 1. in intervals of .1 and assessing the value by interpolation in intervals of .05. Plot the function and what results from using approximation.

    3. Solving Equations of one unknown.

      (Parts of Homework 1 of Chapter 5 of Judd's book.) Solve sin 2

      x- 2x=0 using bisection between x 0 =-5 and x 1 =5 (If this interval is a bad one change it).

    4. Production Function manipulation.

      Compute labor factor shares with a CES production function

      Y=[ q K r +(1- q )N r )] 1/ r

      when K=N=1, and K=2, N=1. Are they the same?

      What about with Cobb-Douglas ( r =1).

      Note that Labor share = w*N/Y, and that under competition w=(dY/dN).

    5. Using symbolic software to obtain derivatives.

      Write in two equations in the capital-labor ratio and total labor the steady state conditions of the growth model with log utility and constant Frisch elasticity of labor (look up what this means if necessary). Use the CES production function with depreciation. Use mathematica or maple or matlab with the symbolic toolbox or even sciword if this does the job.

    6. Fetching data, U.S. and abroad.

      6.A Obtain and plot, since the earliest that you can after 1950, U.S. GDP, Consumption, Investment, Government expenditures, Employment, and the CPI.

      6.B Decompose and plot one of the series between a time trend (constant growth rate) and a residual.

      6.C Obtain the same series for your favorite European or Asian country and plot them and get the Solow residuals of the same series than the one you did for the U.S. Compare them and make some brief comments on what you see.

    7. Computation of the Solow Residual.

      7.A Use NIPA and the logic of the imputation of income to either labor or capital found in Cooley and Prescott (1996) to compute an updated series of the Solow residual.

      7.B Take away a linear trend (in logs) of the Solow residual and rename the new object alos as linearly detrended Solow residual. Estimate a univariate process for this new variable. Make sure that you argue forcefully for your specification.

      7.C Compute a bivariate VAR with the linearly detrended Solow residual and linearly detrended output and a linearly detrended trivariate VAR with the Solow residual, output and linearly detrended hours worked.




  • Second Homework batch. Business Cycles Questions. Due Wed Oct 3.

    1. Use a standard growth model suitable to measure the contribution of productivity shocks as represented by the Solow residual to movements in output and hours worked between 1954-2012.

      8.A Specify some steady targets that your model should satisfy.

      8.B Solve for the steady state. Be lazy and use software to get the derivatives and dynare to get the steady state.

      8.C Answer the question using dynare and the estimated process for the Solow residual.

      8.D Reassess your answer with data since 1982. Get labor data from Manovskii, here and described here of labor in the CPS and reestimate your answer.

      8.E Redo your answer posing alternative processes for the Solow residual (random walk with drift, AR(2)).


    2. Using a growth model with separable utility.

      9.A Specify the steady targets that your model should satisfy. Argue your case thoroughly.

      9.B Compute your answer using dynare.

      9.C Explore alternative specifications of the calibration targets based on some alternative logic and report your answers. What matters.

      9.D Redo your answer posing TFP shocks and shocks to the relative price of investment (which you have to compute using mostly Violante and coauthor's series).


    1. Comparison of calibration and estimation.

      10.A Pose a version of the model with the same steady state calibration than in Question 9 but now estimate processes for two independent shocks. One to hours worked in the utility function and another to the Solow residual using data of output and hours by using ML or by Bayesian methods.

      10.B Do it again with three independent shocks. One to hours worked in the utility function, another to patience, and another to productivity using data of output the Solow residual and hours by using ML or by Bayesian methods.

      10.C Redo the estimation adding labor share and the Frisch elasticity of labor to the parameters that govern the three shocks.

      10.D Compare the answers obtained in 10.A, 10.B, and 10.C.




  • Third Homework batch. A global approximation. Due Wed Oct 10.

    1. Global approximation.

      11.A Take a deterministic version of the growth model without leisure. Find the steady state and construct a 21 point grid from half to two times the steady state of capital. Do it in logs.

      11.B Write a f90 or f95 code that computes a piecewise linear approximation to the decision rule of capital for the optimal capital accumulation function. Use collocation (or the Dirac measures at the grid points) to weigh the errors. Plot it. If you insist, use some alternative global solution method.

      11.C Compare it with one that results from doing the same approximation with only 7 grid points over the same range. Was it worth to go from 7 to 21 grid points?

      11.D Use now the endogenous grid method to solve for the decision rule for capital (in case you did not use for parts B and C).

      11.E Do it now for a stochastic version of the growh model with leisure. Use this paper for details.


  • Fourth Homework batch. The Aiyagari Economy I Due Wed Oct 14.
    1. The household problem

      11.A Write fortran (or C, but better f95) code for the problem that a household solves in an Aiyagari economy without leisure and a Markov shock to earnings. Use the calibration of say my paper with Antonia Diaz and Josep Pijoan (or another is you prefer it). Make sure that in your parameterization of the problem you choose an arbitrary value for the wage and a value for the interest rate that is small (smaller than (1/beta)-1). Use the endogenous grid method with piecewise linear interpolations in the Euler equation.



  • Fifth Homework batch. The Aiyagari Economy II Due Wed Oct 24.
    1. The household problem

      Use the decision rules of the previous problem,

      12.A Compute the steady state of this economy. Use both an approximation to the cdf. And a huge sample.

      12.B Compute and plot the Lorenz curve for earnings.

      12.C Compute the persistence of inequality in this economy. Choose a statistic, compute it and argue its usefulness.



  • Sixth Homework batch. Data Sets Questions. Do one of the two. Due Oct 31.
    1. Read data sets: I. The Cross-Section data set Problem.

      Denote by i,g your own age plus 17 and your gender. Now take the CPS or the CEX and find out the average number of hours worked by people of type g, i plus/minus 2. Sort this group into quartiles by education, and report the average time worked and the average wage for those that work, the average time worked per person, the fraction that work, the fraction married, the number of children among those married and the number of children per parent. This for the years 1980 and the latest available. Report an additional feature of this group that you may find interesting.

      As an added bonus go back to 1970 through 1979.

    2. Read data sets: II. The Panel-Data data sets question.

      Create a table describing the time series properties using PSID data with information on household heads- their gender, marital status, number of other people in the household, hours worked by each member of the household and their wage rates. Use this data to think about a way to summarize hours worked and the labor force engagement per household over time. Also track the stability of households over time i.e. changes in marital status and number of household members. Do you notice any interesting features?



  • Seventh Homework batch. General equilibrium and Transition issues in the Aiyagari Economy Due Wed Nov 7.
    1. General equilibrium and Taxation.

      15.A Compute the interest rate and wage that constitute a stationary equilibrium of a closed Aiyagari economy.

      15.B Compute the steady state equilibrium when the government sets a 20% tax on labor income and gives it as lump sum to all agents.

      15.C What about the tax on total income? Is it as easy to calculate?

      15.D Write an algorithm to calculate the welfare benefits, if any, of the two policies of 12.C when imposed from the steady state of the economy without taxes.

  • Eigth Homework batch. The easy and the hard krusell Smith approximation of state variables. Issues of calibration in the Aiyagari Economy. Solving for the GEE. Due Wed Nov 21.
    1. Business cycles in the Aiyagari economy without leisure.

      Get your economy in 12.A and pose TFP shocks that follow an AR(1). Approximate the AR(1) with a three state Markov chain that is symmetric, spends one third of the time in each state and has a standard deviation of the innovation of .00763 and an autocorrelation of .9. Solve it and simulate it using the methods that we discussed in the Halloween day class.

    2. Business cycles in the quarterly Aiyagari economy with leisure.

      Calibration of the Aiyagari economy. Pose a quarterly version of the 12.A economy (adjust the interest rate, the wealth to output ratio, the shock process) with leisure (separable utility with risk aversion equal 2, a Frisch elasticity of .7 and more or less 30% of the time working. Do business cycle analysis.

    3. The GEE.

      Compute the steady state of the Markov equilibria of the hyperbolic discuounting economy with beta being .96 and delta being .9.


  • Ninth Homework batch. An implementation of a homework in MPI Due Wed Dec 5.
    1. Extend to MPI ready one of the homeworks that you have done. You can aslo choose any piece of code to extend for this purpose. Report the gains from going from 1 to 10 processors. You can use for help the instructions here.


  • Tenth Homework batch. Calibrating the Aiyagari economy. Due Wed Dec 12.
    1. Change the process for the idyosincratic shock (s and Gamma) as well as the discount rate beta so that the model economy replicates the U.S. values of many points of the Lorenz curves of earnings and wealth and their correlations and persistence (use this) for data sources. Make sure that the equilibrium interest rate is 4%. Try if you want this minimization routine for estimation purposes.