Skip to content

Commit

Permalink
FIX - updated r-square computation (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
schoffelen committed Nov 16, 2018
1 parent 956792b commit 4cadff3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ft_denoise_tsr.m
Expand Up @@ -456,7 +456,8 @@
weights.performance(k,1) = tmp(1,2)./sqrt(tmp(1,1).*tmp(2,2));
end
case 'r-squared'
tss = nansum(observed.^2, 2); % total sum of squares, testdata are already mean subtracted in l. 330
tss = nansum((observed.*isfinite(predicted)).^2, 2); % total sum of squares,
% use only the samples where both predicted and observed are non-nan, testdata are already mean subtracted in l. 330
rss = nansum((observed - predicted).^2, 2); % sum of squared residual error
% R-squared
weights.performance = (tss-rss)./tss;
Expand Down

0 comments on commit 4cadff3

Please sign in to comment.