Skip to content

Commit

Permalink
remove dependency from statistics toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
pucicu committed Sep 23, 2024
1 parent cb96f0a commit 322b3a4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rqa.m
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@
l_prob = l_hist(l_hist~=0)/sum(l_hist(l_hist~=0)); % get probability distribution from histogram
ent_Sum = (l_prob .* log(l_prob));
if l_classes > 1
y(5) = -nansum(ent_Sum)/log(N(1));
y(5) = -sum(ent_Sum(~isnan(ent_Sum)))/log(N(1));
else
y(5) = -nansum(ent_Sum);
y(5) = -sum(ent_Sum(~isnan(ent_Sum)));
end

% histogram of vertical lines
Expand Down Expand Up @@ -244,15 +244,16 @@
rt_prob = rt_hist(rt_hist~=0)/sum(rt_hist(rt_hist~=0)); % get probability distribution from histogram
ent_Sum = (rt_prob .* log(rt_prob));
if rt_classes > 1
y(11) = -nansum(ent_Sum)/log(N(1));
y(11) = -sum(ent_Sum(~isnan(ent_Sum)))/log(N(1));
else
y(11) = -nansum(ent_Sum);
y(11) = -sum(ent_Sum(~isnan(ent_Sum)));
end

if netw
% clustering
kv = sum(x_theiler,1); % degree of nodes
y(12) = nanmean(diag(x_theiler*x_theiler*x_theiler)' ./ (kv .* (kv-1)));
clustering_coeff = diag(x_theiler*x_theiler*x_theiler)' ./ (kv .* (kv-1));
y(12) = mean(clustering_coeff(~isnan(clustering_coeff)));

% transitivity
denom = sum(sum(x_theiler * x_theiler));
Expand Down

0 comments on commit 322b3a4

Please sign in to comment.