MATLAB: How to create a multidimensional SDE object with some processes following different models

Econometrics Toolbox

I want to create a single, multidimensional Stochastic Differential Equation(SDE) object using the Econometrics toolbox, with some processes following different models. For instance one process might be following GBM model and the other a mean reverting drift model.

Best Answer

You can combine different processes into a single SDE object by creating your own diffusion and drift functions, and use them to create the SDE object. Here is an example that illustrates this further:
%Create the following SDE composed of GBM and Mean Rverting drfit.
% dX(1) = 0.25*X(1)dt + 0.3*X(1)dW(1)
% dX(2) = 0.2*(0.1 -X(2))dt + 0 0.05*X(2)^0.5dW(2)
F = @(t,X) [ 0.25 * X(1); 0.2*(0.1 -X(2))]; %Drift term. 1st element
corresponds to GBM, 2nd term corresponds to Mean-Reverting Drift.
G = @(t,X) [ 0.3 * X(1) 0; 0 0.05*X(2)^0.5]; %Diffusion term. 1st row
corresponds to GBM, 2nd row corresponds to Mean-Reverting Drift process.
obj = sde(F, G, 'StartTime', 10, 'StartState', [10; 20], 'Correlation',
[1 2;2 1] ); %Create the SDE object.