%% Compute Price and Sensitivities for an American Option Using the Merton Model
% Define the option variables and Merton model parameters.

AssetPrice = 90;
Strike = 100;
Rate = 0.06;
DividendYield = 0.1;
Settle = '01-Jan-2018';
ExerciseDates = '02-Apr-2018';

Sigma = 0.40;
MeanJ = -0.10;
JumpVol = 0.01;
JumpFreq = 1.00;

% Compute the American call option price and sensitivities using the finite differences method.

OptSpec = 'Call';

[Price, Delta, Gamma, Rho, Theta, Vega] = optSensByMertonFD(Rate, AssetPrice, Settle, ExerciseDates, OptSpec, Strike,...
Sigma, MeanJ, JumpVol, JumpFreq, 'DividendYield', DividendYield, 'AmericanOpt', 1,...
'OutSpec', ["Price" "Delta" "Gamma" "Rho" "Theta" "Vega"])

% Copyright 2018 The MathWorks, Inc.