ECONOMICS 951
NUMERICAL METHODS FOR
ECONOMICS AND ECONOMETRICS
Assignment 1.1
- Write a function
wstar(const theta,const ev0,const eps1)
which iteratively
calls wrt
and 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.
- 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.
- 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.
- 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
.