% % Solve the transcendental equation associated with the local solution % near the free boundary of an American option. This corresponds to equation % 7.24 in Wilmott's book. % % Written by: % -- % John L. Weatherwax 2008-06-11 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- clc; close all; fn = inline( '2*sqrt(pi)*(x^3)*exp(0.25*x^2)*normcdf(x,0,sqrt(2))-2*(2-x^2)', 'x' ); figure; x = linspace(0.7,1,100); y = zeros(size(x)); for ii=1:length(x) y(ii) = fn(x(ii)); end plot( x, y, '-x' ); grid on; axis tight; rt = fsolve( fn, 0.9 ); fprintf('root found is %10.6f\n',rt);