%% Use simByTransition with bates Object
% Simulate Bates sample paths with transition density.
% Define the parameters for the bates object.

AssetPrice = 80;
Return = 0.03;
JumpMean = 0.02;
JumpVol = 0.08;
JumpFreq = 0.1;
V0 = 0.04;
Level = 0.05;
Speed = 1.0;
Volatility = 0.2;
Rho = -0.7;
StartState = [AssetPrice;V0]; 
Correlation = [1 Rho;Rho 1];

% Create a bates object.

batesObj = bates(Return, Speed, Level, Volatility,...
                JumpFreq, JumpMean, JumpVol,'startstate',StartState,...
                'correlation',Correlation)

% Define the simulation parameters.

nPeriods = 5;   % Simulate sample paths over the next five years
Paths = simByTransition(batesObj,nPeriods);
Paths

% Copyright 2020 The MathWorks, Inc.