ECONOMICS 951
NUMERICAL METHODS FOR
ECONOMICS AND ECONOMETRICS

Assignment 1.1

  1. Write a function wstar(const theta,const ev0,const eps1) which iteratively calls wrtand evt until the reservation wage converges and returns the resulting value. It begins withEV set to the constant parameter ev0, and it stops when the change in the reservation wage falls below eps1. Graph the results as a function of a range of values of the three parameters.
  2.  
  3. Write a function dwsta(const theta, const ev0, const eps1) that calculates the gradient of wstar with respect to the parameters theta analytically. It returns a 3 x 1 vector. It cannot really compute an analytical derivative, because the expressions depend on , which can only be computed numerically. So dwsta must call wstar and therefore requires ev0 and eps1 as input.
  4.  
  5. Write a function dwstn(const theta,const ev0,const eps1,const eps2) that calculates the same gradient numerically. The new parameter eps2 is the percentage step to take to calculate the gradient in each parameter.
  6.  
  7. Compare the results of your numerical gradient with Ox, Num1Derivative, which will requires a function of form func(const vP, const adFunc, const avScore, const amHessian). Graph the values of the gradients as a function of eps2 along with the constant (relative to eps2) values returned by dwsta and Num1Derivative.
  8.