Parameter estimation — DMAToolbox —
1 min readMay 17, 2018
% % % % DMAT toolbox parameter estimation
% % % Laure Bottemanne may2018
%%% last update 17may2018
clear all;close all;
% PATHS
expath = 'Your\Own\Path';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if exist([expath 'dmat_res'], 'dir')==0
mkdir ([expath 'dmat_res'])
end; % if exist
dmat_respath = [expath 'dmat_res\'];
rawpath = [expath 'logdmat\'];
files_dmat = ls([rawpath '*.mat']); %
files = dir([rawpath '*.mat']);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
modele2test = {'null_model' , 'vCoh'};
% %%%%%%%%%%%%% DMAT PARAMETER ESTIMATION LOOP %%%%%%%%%%%%%%%
for modele_number = 1:length(modele2test)
modele_name = char(modele2test(modele_number));
disp('model');disp(modele_name);
model2execute = [ modele_name ...
'.S(files_dmat_count).dmat = do_dmat12c (datadmat, a, v, Ter)'];
for files_dmat_count = 1:length(files_dmat)
load([rawpath files_dmat(files_dmat_count,:)]);
[a v Ter] = vicV2_xp_dmat_parametersettings_12c(modele_name);
eval(model2execute);
end;
cct2execute = [ modele_name '.dmat = vertcat (' modele_name '.S.dmat)'];
eval(cct2execute);
dmatinfo2execute = [ modele_name ...
'.dmatinfo = do_dmatinfo12(' modele_name '.dmat)'];%, dmatpath'];
eval(dmatinfo2execute);
disp( [' DMAT estimation ' modele_name 'done! ']);
save ([dmat_respath modele_name],modele_name);
end;
see the the function used do_dmat12c do_dmatinfo12 vicV2_xp_dmat_parametersettings_12c