correlation top-level property

dynamic correlation
getter/setter pair

Returns the correlation of two lists.

Example:

print(correlation([1,2,3], [1,2,3])); // 1.0

Implementation

dynamic correlation = VarArgsFunction((args, kwargs) {
  if (args.length != 2 || args[0] is! List || args[1] is! List) {
    throw ArgumentError('correlation requires two lists: x and y');
  }
  return Complex(_correlation(_toNumList(args[0]), _toNumList(args[1])));
});