How can I make the following line of code run faster? Is there a way to do this calculation as a matrix vs vector than vector vs vector?
In the code below, f
is a matrix with one more row than vector
. f
has many columns and vector
has only one column.
vector=RandomReal[1,100000];
f=RandomReal[1,{100001,520}];
pearson = Map[Correlation[f[[2 ;;, #]], vector] &, Range[5, Dimensions[f][[2]]]];