Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Nonlinear econometrics for finance

HOMEWORK 2

Minimization, GMM and C-CAPM

 

The homework consists of a review of matlab functions and miminization, and an estimation exercise for the CCAPM using the GMM estimator. Please scan the derivations of your answers to the theoretical questions (if you have done it by hand) and make it into a .doc or .pdf file.  Then attach to the answers. Please, provide the files with the Matlab code for the first problem and for the estimation of the CCAPM.

If you have a Matlab Live Script file, please export it into a .doc file or .pdf file.

(HINT: the estimation is similar to what we have seen in class, but the data are monthly and not quarterly; also the data contains the consumption growth  and not the levels of consumptions.  So you need to modify the functions to compute the moment conditions and the GMM criterion func- tion.)

 

Problem 1.  (40 points) Use Matlab to answer the following questions.

1.  (5 points) Write a function in Matlab that takes as input a vector of 2 dimensions x = (xl , x2 ) and returns the value

y = xl(2) + 3x2(2) + 2xl x2(l)/2

(1)

2.  (5 points) Using Matlab, evaluate the value of the function when x = (1, 1). What if x = (3, 2)?

3.  (5 points) Write a script that finds the minimizer (xl(*), x2(*)) and the min- imum f (xl(*), x2(*)) of the function. (Hint: use fminsearch.)

4.  (5 points) Now write another function, that takes 3 inputs. 1) a N × 1 vector of parameters θ; 2) a N × 1 vector x; 2) a N × N matrix A. The output of the function is z = (x 一 θ)T A(x 一 θ), where the notation xT is the transpose of x. We want to minimize this function with respect to θ. Use fminsearch to find the vector θ that minimizes this function when the vector x and the matrix A are

 2(1)

x =  '(')3 '(')

'4'

 

and

0(1)   1(0) A =  '(')0   0 '0   0

0

0

1

0

0(0)'

0 '

 

(2)

(Hint:  you should think as θ as the vector of variables, and x, A as “data”.   You can add  “data” in fminsearch, just add more inputs after the options. )

5.  (5 points) Use fminsearch to find the vector θ that minimizes this function when the vector x and the matrix A are

┌ ┐2(1)                                   ┌

x =  '(')3 '(')          and            A =  '(')0.2   0 .4     1     0 .2 '(')             (3)

'4'                                  '0.3   0.5   0.2     1 '

6.  (5 points) Now write a new function that takes 2 inputs.  1) A T × 1 vector x and 2) a scalar θ. The output of the function is

T

L =        [xt log(θ) + (1 + xt ) log(1 一 θ)]                      (4)

t=l

7.  (10 points) Generate the vector x using the following code in Matlab.

rng(1)

T  =  10000;

x  =  random(’Binomial’,  1,  0.3,  1,  T)’;

Compute the value of θ that maximizes function (4) using fminsearch in Matlab.

2

(HINT : You need to use the fact that

max f (θ) = min (f (θ))

θ                           θ

In other words, computing the maximum of a function is equivalent to computing the minimum of the function with a minus sign in front of it.)

Problem 2.  (60 points)

Consider, as we did in class, a representative investor who lives for two peri- ods (t and t + 1) and has income et  in period t and etl  in period t + 1. The utility function of the representative investor is:

U (ct , ctl) = u(ct ) + β∶t [u(ctl].

The investor can invest in an asset by buying ϑ shares at the unit price pt .  The asset’s payoff xtl  in the second period is uncertain.  The investor chooses how many units (ϑ) of the asset to buy in order to maximize her/his utility function:

mϑ(a)x u(ct ) + β∶t [u(ctl],

subject to the income/wealth constraints

ct     =   et 一 ϑpt ,

ct+l     =   et+l  + ϑxt+l .

1.  (2 point) Assume the investor has a CRRA utility:

u(ct ) =  ct(l) -γ 

Derive the economy’s pricing equations both in terms of prices and in terms of returns.

2.  (2 points) Use the return equation to derive estimable moment condi- tions.

3.  (6 points) The data in the file ccapmmonthlydata.xls are monthly data on consumption growth and asset returns from February 1959 to November  1993  (not quarterly as in the first homework).   The first

column contains the date; the second column contains the time series for the consumption growth . Columns 3-12 are your asset returns

for 10 assets.

Use the ccapmmonthlydata.xls data on 10 portfolios to estimate the parameters of the CCAPM using the GMM estimator.  Let N denote the number of assets/portfolios and let d be the number of parameters to estimate.

(HINT: note that the data contains consumption growth  for t = 1, ..., T and not consumption levels ct  for t = 1, ..., T.  Modify the code I provided in class accordingly, to compute the moments correctly.)

Compute first-stage GMM estimates of the d model parameters using the weight matrix WT  = IN . For this step, assume that your data are an i.i.d. sample.

4.  (10 points) Second stage.  Using the first-stage estimates, re-estimate the parameters using the optimal weight matrix. Assume, again, that your data are i.i.d.

5.  (5 points) ompute the standard errors for the estimates. When comput- ing the matrix T , please compute the derivatives by hand and provide the formulas.  In other words, do not use the function gradient in Matlab to compute these values.

6.  (10 points) Interpret your estimation results in economic terms. What do you learn about the representative investor?

7.  (5 points) Test whether β = 0.9.

8.  (10 points) Test whether γ = 4 and β = 0.9 jointly.

9.  (5 points) Test whether 50β = γ .

10.  (10 points) Test for over-identifying restrictions.