Faster Kendall correlation calcuation

2 次查看(过去 30 天)
Jon
Jon 2018-1-19
编辑: Jon 2018-1-19
I need to do billions of Kendall correlations (yes, billions thank the gods for supercomputers) so I would like to make the correlation function faster for my particular needs. I have already cut down MATLAB's base version from about 0.062 seconds to 0.043 seconds (for a vector with just over 3000 elements) and made it compatible for use within parfor loops by removing the recursion (by having the perm function call perm1 which calls perm2 up to 9 which it never gets to). 0.03 seconds of this time is a single line for loop
K = 0;
for k = 1:n-1
K = K + sum(sign(xrank(k)-xrank(k+1:n)).*sign(yrank(k)-yrank(k+1:n)));
end
Is there a way to make this part faster that perhaps sacrifices memory instead of time for instance?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by