Function spearmanMatrix

These overloads allow for correlation and covariance matrices to be computed with the results being stored in a pre-allocated variable, ans. ans must be either a SciD matrix or a random-access range of ranges with assignable elements of a floating point type. It must have the same number of rows as the number of vectors in mat and must have at least enough columns in each row to support storing the lower triangle. If ans is a full rectangular matrix/range of ranges, only the lower triangle results will be stored.

void spearmanMatrix(RoR, Ret) (
  RoR mat,
  ref Ret ans,
  TaskPool pool = null
)
if (isInputRange!RoR && isInputRange!(ElementType!RoR) && !isInfinite!RoR && (is(typeof(ans[0, 0] = 2.00000)) || is(typeof(ans[0][0] = 2.00000))));

Note

These functions can be used without SciD because they don't return SciD types.

Examples

auto pearsonRoR = [[0.0], [0.0, 0.0], [0.0, 0.0, 0.0]];
pearsonMatrix(input, pearsonRoR);
assert(approxEqual(pearsonRoR[1][1], 1));