One computes a correlation between two sets of numbers of the same size, so corr in the Fortran standard library should work for two 1-D arrays x and y of the same length. The current specification computes the correlation matrix of the rows columns of x(:,:), which is also fine.

I suggest that corr in Fortran be modeled after cor in R, which works with 1 or 2 array arguments. Similarly, cov in Fortran should optionally work with two array arguments.

I implemented most of the functions in stdlib_stats, and I agree with both of you that corr and cov should also accept 2 arrays. As @gareth mentioned it, it has been mentioned and discussed a bit in stdlib issues and PR. Unfortunately I didn’t find the time to progress on it. Your help and ontributions would be much appreciated