Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TommasoBelluzzo committed Dec 2, 2020
1 parent a7247dd commit 59840bd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ScriptsMeasures/run_tail_dependence.m
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ function plot_asymptotic_indicators(ds,id)
set(sub_2,'XLim',[ds.DatesNum(1) ds.DatesNum(end)],'XTickLabelRotation',45);
set(sub_2,'XGrid','on','YGrid','on');
title(sub_2,ds.LabelsIndicators(2));

set([sub_1 sub_2],'YLim',[0 1]);

if (ds.MonthlyTicks)
date_ticks([sub_1 sub_2],'x','mm/yyyy','KeepLimits','KeepTicks');
else
Expand Down
4 changes: 2 additions & 2 deletions ScriptsModels/asymptotic_tail_dependence.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@
if (any(nan_counts > nan_threshold))
error(['The value of ''data'' is invalid. Expected input to contain no more than 70% of NaN values (' num2str(nan_threshold) ') for each time series.']);
end

for i = 2:ceil(t / bw)
bw_i = bw * i;

if ((bw_i / t) >= 0.3)
bw = bw_i;
break;
Expand Down
8 changes: 4 additions & 4 deletions ScriptsModels/granger_causality.m
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,18 @@

x = x(:);
tx = numel(x);

if (tx < 5)
error('The value of ''x'' is invalid. Expected input to be a vector containing at least 5 elements.');
end

y = y(:);
ty = numel(y);

if (ty < 5)
error('The value of ''y'' is invalid. Expected input to be a vector containing at least 5 elements.');
end

if (tx ~= ty)
error('The value of ''x'' and ''y'' are invalid. Expected inputs to contain the same number of elements.');
end
Expand Down
18 changes: 9 additions & 9 deletions ScriptsModels/lasso_quantile_regression.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
[q,r,nu0,nu,lambda0,idx_v,idx_e,idx_l,idx_r] = initialize(y,x,a);

fit = zeros(ms+1,t);

beta = zeros(ms+1,n);
beta0 = [q; zeros(ms,1)];

o = ones(1,t) .* q;
fit(1,:) = o;
gacv = [(gacv_fit(o,y,a) / t); zeros(ms,1)];

lambda = [lambda0; zeros(ms,1)];

k = 0;
Expand All @@ -69,7 +69,7 @@

exc_t = idx_t(~ismember(idx_t,idx_e));
gamma = nu0 + (x(exc_t,idx_v) * nu);

delta1 = r(exc_t) ./ gamma;

if (all(delta1 <= 0))
Expand Down Expand Up @@ -199,7 +199,7 @@

[~,idx] = min(lambda_obs);
i_star = tmp_e(idx);

idx_e = tmp_e;
idx_e(idx) = [];

Expand Down Expand Up @@ -240,7 +240,7 @@
else
f = @(tmp,j_star,s)[tmp [s * 1; x(idx_e,j_star)]];
end

b = [1; zeros(numel(idx_v) + 1,1)];

var = numel(b);
Expand Down Expand Up @@ -332,17 +332,17 @@
if (ty < 5)
error('The value of ''y'' is invalid. Expected input to be a vector containing at least 5 elements.');
end

if (isvector(x))
x = x(:);
tx = numel(x);

if (tx ~= ty)
error(['The value of ''x'' is invalid. Expected input to be a vector containing ' num2str(ty) ' elements.']);
end
else
tx = size(x,1);

if (tx ~= ty)
error(['The value of ''x'' is invalid. Expected input to be a matrix containing ' num2str(ty) ' rows.']);
end
Expand Down

0 comments on commit 59840bd

Please sign in to comment.