Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TommasoBelluzzo authored Oct 25, 2020
1 parent acf3025 commit 83fd36e
Show file tree
Hide file tree
Showing 26 changed files with 678 additions and 284 deletions.
28 changes: 9 additions & 19 deletions ScriptsMeasures/run_comparison.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
% sc = Optional argument specified as a vector of floats [0,Inf) of length 3 representing the score coefficient of each comparison model (Granger-causality, Logistic, Price Discovery).
% When defined, comparison models with a coefficient equal to 0 are not computed. When left undefined, all the comparison models are computed and their scores are equally weighted.
% lag_max = An integer [2,Inf) representing the maximum lag order to be evaluated for Granger-causality and Price Discovery models (optional, default=10).
% lag_sel = A string ('AIC', 'BIC', 'FPE' or 'HQIC') representing the lag order selection criteria for Granger-causality and Price Discovery models (optional, default='AIC').
% lag_sel = A string representing the lag order selection criteria for Granger-causality and Price Discovery models (optional, default='AIC'):
% - 'AIC' for Akaike's Information Criterion.
% - 'BIC' for Bayesian Information Criterion.
% - 'FPE' for Final Prediction Error.
% - 'HQIC' for Hannan-Quinn Information Criterion.
% gca = A float [0.01,0.10] representing the probability level of the F test critical value for the Granger-causality model (optional, default=0.01).
% lma = A boolean that indicates whether to use the adjusted McFadden R2 for the Logistic model (optional, default=false).
% pdt = A string (either 'GG' for the Gonzalo-Granger component share or 'H' for the Hasbrouck information share) representing the type of metric to calculate for the Price Discovery model (optional, default='GG').
% pdt = A string representing the type of metric to calculate for the Price Discovery model (optional, default='GG'):
% - 'GG' for Gonzalo-Granger Component Metric.
% - 'H' for Hasbrouck Information Metric.
% analyze = A boolean that indicates whether to analyse the results and display plots (optional, default=false).
%
% [OUTPUT]
Expand Down Expand Up @@ -297,23 +303,7 @@

function temp = validate_template(temp)

if (exist(temp,'file') == 0)
error('The template file could not be found.');
end

if (ispc())
[file_status,file_sheets,file_format] = xlsfinfo(temp);

if (isempty(file_status) || ~strcmp(file_format,'xlOpenXMLWorkbook'))
error('The template file is not a valid Excel spreadsheet.');
end
else
[file_status,file_sheets] = xlsfinfo(temp);

if (isempty(file_status))
error('The template file is not a valid Excel spreadsheet.');
end
end
file_sheets = validate_xls(temp,'T');

if ((numel(file_sheets) ~= 1) || ~strcmp(file_sheets{1},'Scores'))
error('The template must contain only one sheet named ''Scores''.');
Expand Down
19 changes: 1 addition & 18 deletions ScriptsMeasures/run_component.m
Original file line number Diff line number Diff line change
Expand Up @@ -574,25 +574,8 @@ function plot_pca(ds,id)

function temp = validate_template(temp)

if (exist(temp,'file') == 0)
error('The template file could not be found.');
end

if (ispc())
[file_status,file_sheets,file_format] = xlsfinfo(temp);

if (isempty(file_status) || ~strcmp(file_format,'xlOpenXMLWorkbook'))
error('The dataset file is not a valid Excel spreadsheet.');
end
else
[file_status,file_sheets] = xlsfinfo(temp);

if (isempty(file_status))
error('The dataset file is not a valid Excel spreadsheet.');
end
end

sheets = {'CATFIN VaRs' 'Indicators' 'PCA Overall Explained' 'PCA Overall Coefficients' 'PCA Overall Scores'};
file_sheets = validate_xls(temp,'T');

if (~all(ismember(sheets,file_sheets)))
error(['The template must contain the following sheets: ' sheets{1} sprintf(', %s', sheets{2:end}) '.']);
Expand Down
19 changes: 1 addition & 18 deletions ScriptsMeasures/run_connectedness.m
Original file line number Diff line number Diff line change
Expand Up @@ -592,25 +592,8 @@ function plot_centralities(ds,id)

function temp = validate_template(temp)

if (exist(temp,'file') == 0)
error('The template file could not be found.');
end

if (ispc())
[file_status,file_sheets,file_format] = xlsfinfo(temp);

if (isempty(file_status) || ~strcmp(file_format,'xlOpenXMLWorkbook'))
error('The dataset file is not a valid Excel spreadsheet.');
end
else
[file_status,file_sheets] = xlsfinfo(temp);

if (isempty(file_status))
error('The dataset file is not a valid Excel spreadsheet.');
end
end

sheets = {'Indicators' 'Average Adjacency Matrix' 'Average Centrality Measures'};
file_sheets = validate_xls(temp,'T');

if (~all(ismember(sheets,file_sheets)))
error(['The template must contain the following sheets: ' sheets{1} sprintf(', %s', sheets{2:end}) '.']);
Expand Down
31 changes: 10 additions & 21 deletions ScriptsMeasures/run_cross_entropy.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
% temp = A string representing the full path to the Excel spreadsheet used as a template for the results file.
% out = A string representing the full path to the Excel spreadsheet to which the results are written, eventually replacing the previous ones.
% bw = An integer [21,252] representing the dimension of each rolling window (optional, default=252).
% sel = A string (either 'F' for firms or 'G' for groups) representing the time series selection method (optional, default='F').
% sel = A string representing the time series selection method (optional, default='F'):
% - 'F' for firms.
% - 'G' for groups.
% rr = A float [0,1] representing the recovery rate in case of default (optional, default=0.4).
% pw = A string (either 'A' for plain average or 'W' for progressive average) representing the probabilities of default weighting method (optional, default='W').
% md = A string (either 'N' for normal or 'T' for Student's T) representing the multivariate distribution used by the CIMDO model (optional, default='N').
% pw = A string representing the probabilities of default weighting method (optional, default='W'):
% - 'A' for plain average.
% - 'W' for progressive average.
% md = A string representing the multivariate distribution used by the CIMDO model (optional, default='N'):
% - 'N' for normal distribution.
% - 'T' for Student's T distribution.
% analyze = A boolean that indicates whether to analyse the results and display plots (optional, default=false).
%
% [OUTPUT]
Expand Down Expand Up @@ -930,25 +936,8 @@ function plot_function(subs,data)

function temp = validate_template(temp)

if (exist(temp,'file') == 0)
error('The template file could not be found.');
end

if (ispc())
[file_status,file_sheets,file_format] = xlsfinfo(temp);

if (isempty(file_status) || ~strcmp(file_format,'xlOpenXMLWorkbook'))
error('The dataset file is not a valid Excel spreadsheet.');
end
else
[file_status,file_sheets] = xlsfinfo(temp);

if (isempty(file_status))
error('The dataset file is not a valid Excel spreadsheet.');
end
end

sheets = {'Indicators' 'Average DiDe' 'SI' 'SV' 'CoJPoDs'};
file_sheets = validate_xls(temp,'T');

if (~all(ismember(sheets,file_sheets)))
error(['The template must contain the following sheets: ' sheets{1} sprintf(', %s', sheets{2:end}) '.']);
Expand Down
25 changes: 5 additions & 20 deletions ScriptsMeasures/run_cross_quantilogram.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
% bw = An integer [21,252] representing the dimension of each rolling window (optional, default=252).
% a = A float [0.01,0.10] representing the target quantile (optional, default=0.05).
% lags = An integer [10,60] representing the maximum number of lags (optional, default=60).
% cim = A string (either 'SB' for stationary bootstrap or 'SN' for self-normalization) representing the computational approach of confidence intervals (optional, default='SB').
% cim = A string representing the computational approach of confidence intervals (optional, default='SB'):
% - 'SB' for stationary bootstrap.
% - 'SN' for self-normalization.
% cis = Optional argument representing the significance level of confidence intervals and whose value depends on the the chosen computational approach:
% - for stationary bootstrap cross-quantilograms, a float (0.0,0.1] (default=0.050);
% - for self-normalization cross-quantilograms, a float {0.005;0.010;0.025;0.050;0.100} (default=0.050).
Expand Down Expand Up @@ -551,26 +553,9 @@ function plot_function(subs,data)

function temp = validate_template(temp)

if (exist(temp,'file') == 0)
error('The template file could not be found.');
end

if (ispc())
[file_status,file_sheets,file_format] = xlsfinfo(temp);

if (isempty(file_status) || ~strcmp(file_format,'xlOpenXMLWorkbook'))
error('The template file is not a valid Excel spreadsheet.');
end
else
[file_status,file_sheets] = xlsfinfo(temp);

if (isempty(file_status))
error('The template file is not a valid Excel spreadsheet.');
end
end

sheets = {'Full From' 'Full To' 'Partial From' 'Partial To'};

file_sheets = validate_xls(temp,'T');

if (~all(ismember(sheets,file_sheets)))
error(['The template must contain the following sheets: ' sheets{1} sprintf(', %s',sheets{2:end}) '.']);
end
Expand Down
Loading

0 comments on commit 83fd36e

Please sign in to comment.