ECONOMICS 951
NUMERICAL METHODS FOR
ECONOMICS AND ECONOMETRICS
Assignment 1.2
- Read Chapter II.
- Write a function
imilla(const b)
which returns lambda(d) = E[z | z > d]
that is defined in equation (3) using Ox's normal density and distribution functions,
densn(const ma)
and probn(const ma)
- Write a function
imillmb(const d, const seed, const nrepl)
which returns an estimate of
lambda(d)
using Monte Carlo integration. For d=1.96
find the value of nrepl
which makes the difference between imillmb
and imilla
less than 1 x 106
.
- Write a function
imillc(const d, const m)
which returns an estimate of
lambda(d)
using trapezoid integration for both integrals and a change of variables to handle the
improper integrals. Graph the precision of imillc
to imilla
as a
function of m
.