Here you can find the source of mean(final double[] in, final int start, final int stop)
public static double mean(final double[] in, final int start, final int stop)
//package com.java2s; //License from project: Open Source License public class Main { /** Calculate the mean of an array of doubles. */ public static double mean(final double[] in, final int start, final int stop) { if ((stop - start) <= 0) return Double.NaN; double total = 0; for (int i = start; i < stop; ++i) { total += in[i];//from www.j ava2s . c o m } return total / (stop - start); } }