%% Price an American Option Using the Bates Model
% Define the option variables and Bates model parameters.

AssetPrice = 90;
Strike = 100;
Rate = 0.03;
Settle = '01-Jan-2018';
ExerciseDates = '02-Jul-2018';

V0 = 0.04;
ThetaV = 0.04;
Kappa = 2;
SigmaV = 0.25;
RhoSV = -0.5;
JumpVol = 0.4;
MeanJ = exp(-0.5+JumpVol.^2/2)-1;
JumpFreq = 0.2;

% Compute the American put option price using the finite differences method.

OptSpec = 'Put';
Price = optByBatesFD(Rate, AssetPrice, Settle, ExerciseDates, OptSpec, Strike, ...
V0, ThetaV, Kappa, SigmaV, RhoSV, MeanJ, JumpVol, JumpFreq, 'AmericanOpt', 1)

% Copyright 2018 The MathWorks, Inc.