%% Represent Market Models Using Various SDE Models
%% Load the Data Set

load Data_GlobalIdx2
prices  = [Dataset.TSX Dataset.CAC Dataset.DAX ...
    Dataset.NIK Dataset.FTSE Dataset.SP];

%
%% Convert daily prices to returns

returns =  tick2ret(prices);

%
%% Compute statistics for the simulation

nVariables  = size(returns, 2);
expReturn   = mean(returns);
sigma       = std(returns);
correlation = corrcoef(returns);
t           = 0;
X           = 100;
X           = X(ones(nVariables,1));

%
%% Specify the SDELD Model

SDELD = sdeld(zeros(nVariables,1), diag(expReturn), ...
    ones(nVariables,1), diag(sigma),'Correlation', ... 
    correlation, 'StartState', X)

%
%% Specify the CEV Model

CEV = cev(diag(expReturn), ones(nVariables,1), ... 
    diag(sigma), 'Correlation', correlation, ...
    'StartState', X)

%
%% Specify the GBM Model

GBM = gbm(diag(expReturn), diag(sigma), 'Correlation', ...
    correlation, 'StartState', X)

% Copyright 2015 The MathWorks, Inc.