/* srch1.txt program to solve simplest continuous time search problem */ closeall: output file = search.out reset; /* parameters are defined as follows: rho discount rate c cost of search lam rate of arrival of offers alpha parameter which describes wage offer distribution (F) */ /* assume that wage offer distribution is exponential in this case, with parameter defined by alpha */ fn cdf_f(x,alpha) = 1 - exp( - alpha * x ); fn pdf_f(x,alpha) = alpha * exp(-alpha * x); galpha = 0; gwold = 0; proc i_rhs(x); retp( (x - gwold) .* pdf_f(x,galpha) ); endp; proc rhs(wold,rho,c,lam,alpha); local ulim; ulim = -ln(.005) / alpha; galpha = alpha; gwold = wold; retp( c + lam / rho * intquad1(&i_rhs,(ulim | wold)) ); endp; proc 1=wstar(rho,c,lam,alpha); local crit_val,i,wold,wnew,shrink ; wold = 1/alpha; shrink = .4; crit_val = 1; do until crit_val lt .000001; wnew = shrink * rhs(wold,rho,c,lam,alpha) + (1-shrink) * wold; crit_val = abs( wnew - wold ); wold = wnew; endo; print "************* RW computation ************** "; print "rho = " rho; print "c = " c; print "lam = " lam; print "alpha = " alpha; print "RESERVATION WAGE" wnew; print "VALUE OF SEARCH " wnew/rho; print "unemployment exit rate" ( lam * cdf_f(wnew,alpha) ); retp( wnew ); endp; /* some trial values */ wstar1 = wstar(.03,-1,.3,.1); wstar2 = wstar(.03,-1,.31,.1); end;