function g = tran_payoff_call(xgrid,tau,k) % TRAN_PAYOFF_CALL - the transformed payoff for a call % see page 166 of Wilmott's book (epage 184) % % 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. % %----- % convert to a column vector: xgrid = xgrid(:); nx = length(xgrid); % the transformed payoff: g = exp( 0.25*((k+1)^2)*tau ) * max( [ exp( 0.5*(k+1)*xgrid ) - exp( 0.5*(k-1)*xgrid ), zeros(nx,1) ], [], 2 );