%devc3.m: Procedure to return c derivative of expected value %function at a particular (w,c) point in state space. CRRA U. % Hugo Benitez, Yale University, 1999. function[y]=devc3(c); global wgrid intmeth beta sut periods itt bq i; dev_qw_myh=@dev_qw_my1; dufunc1h=@dufunc1; b=[wgrid(i)-c;1e-9]; a=max(b); z=feval(dev_qw_myh,c); y=feval(dufunc1h,c)+beta*(1-sut(periods-itt))*z-sut(periods-itt)*bq*feval(dufunc1h,a);