The OpenD Programming Language

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.

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

  1. SymmetricMatrix!double spearmanMatrix(RoR mat, TaskPool pool)
  2. void spearmanMatrix(RoR mat, Ret ans, TaskPool pool)
    void
    spearmanMatrix
    (
    RoR
    Ret
    )
    (
    RoR mat
    ,
    ref Ret ans
    ,
    TaskPool pool = null
    )
    if (
    (
    is(typeof(ans[0, 0] = 2.0)) ||
    is(typeof(ans[0][0] = 2.0))
    )
    )

Examples

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

Meta