Here you can find the source of mean(double[] series)
Parameter | Description |
---|---|
series | The timeseries. |
public static double mean(double[] series)
//package com.java2s; //License from project: Open Source License public class Main { /**//from www . j a v a 2s.com * Computes the mean value of timeseries. * * @param series The timeseries. * @return The mean value. */ public static double mean(double[] series) { double res = 0D; int count = 0; for (double tp : series) { if (Double.isNaN(tp) || Double.isInfinite(tp)) { } else { res += tp; count += 1; } } if (count > 0) { return res / ((Integer) count).doubleValue(); } return Double.NaN; } }