diff --git a/ScriptsMeasures/run_tail_dependence.m b/ScriptsMeasures/run_tail_dependence.m index 5fb84a8d..f9eb3651 100644 --- a/ScriptsMeasures/run_tail_dependence.m +++ b/ScriptsMeasures/run_tail_dependence.m @@ -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 diff --git a/ScriptsModels/asymptotic_tail_dependence.m b/ScriptsModels/asymptotic_tail_dependence.m index c98125bd..4f150fd1 100644 --- a/ScriptsModels/asymptotic_tail_dependence.m +++ b/ScriptsModels/asymptotic_tail_dependence.m @@ -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; diff --git a/ScriptsModels/granger_causality.m b/ScriptsModels/granger_causality.m index e828cd46..12459b6b 100644 --- a/ScriptsModels/granger_causality.m +++ b/ScriptsModels/granger_causality.m @@ -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 diff --git a/ScriptsModels/lasso_quantile_regression.m b/ScriptsModels/lasso_quantile_regression.m index d6874d4f..ae404c54 100644 --- a/ScriptsModels/lasso_quantile_regression.m +++ b/ScriptsModels/lasso_quantile_regression.m @@ -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; @@ -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)) @@ -199,7 +199,7 @@ [~,idx] = min(lambda_obs); i_star = tmp_e(idx); - + idx_e = tmp_e; idx_e(idx) = []; @@ -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); @@ -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