Commit 3178ef1a authored by Sam Harrison's avatar Sam Harrison
Browse files

Add cross-subject spatial correlations to scoring

parent c39f0592
......@@ -57,6 +57,35 @@ end
%--------------------------------------------------------------------------
% Spatial accuracy - cross subject correlations
scores.P_xs.data = NaN(params.V, params.N);
scores.P_xs.name = 'Spatial maps (cross subject)';
scores.P_xs.metric = 'Correlation';
scores.P_xs.range = [-1.0, 1.0];
for n = 1:params.N
Pn = NaN(params.V, params.S);
inf_Pn = NaN(params.V, params.S);
for s = 1:params.S
Pn(:,s) = P{s}(:, gt_inds(n));
inf_Pn(:,s) = signs(n) .* inf_P{s}(:, inf_inds(n));
end
% Just the correlations between the two
%cP = diag(corrcoef(Pn', inf_Pn')); % [V, V]: Too big!
dim = 2;
zPn = zscore(Pn, 1, dim); % normalise by N, not N-1
inf_zPn = zscore(inf_Pn, 1, dim);
cP = mean(zPn .* inf_zPn, dim);
% Ignore elements with limited true variability
cP(std(Pn, 1, dim) == 0.0) = NaN;
cP(sum(Pn == 0.0, dim) > 0.2 * params.S) = NaN;
% Return scores in order of GT components so comparable across methods
scores.P_xs.data(:, gt_inds(n)) = cP;
end
%--------------------------------------------------------------------------
% Repeat for the temporal accuracy
% Take correlation between true and inferred time courses
scores.A.data = NaN(sum(params.R), params.N);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment