I have got a list of double arrays as such : List<Double[]> ys
They all contain y-values from a xy-plot. I want to calculate the population standard deviation for all points of x, which in essence is for every element in each array. Example:
Take the first element of every array, calculate population standard deviation, put value in new array. Move to next element in all arrays in list and calculate population standard deviation and put in the newly created array. etc etc until we have reached the end of all the arrays.
Is there anyway I can achieve this quickly without nested for loops using linq or similar?
Example input ys = {[1, 2, 3, 4, 5], [10, 20, 30, 40, 50], [100, 200, 300, 400, 500]}
output: double[] = [44.69899328, 89.39798655, 134.0969798, 178.7959731, 223.4949664]
44.69899328
comes from: 1, 10, 100
89.39798655
comes from : 2, 20, 200
134.0969798
comes from: 3, 30, 300
178.7959731
comes from: 4, 40, 400
223.4949664
comes from: 5, 50, 500