List of utility methods to do mean
double[] | meanAndVariance(double[] a, boolean useUnbiasedEstimate) Computes the mean and variance of the input array and returns the result as a two-element double array: {mean, variance}}, using a numerically stable algorithm described by Welford. return meanAndVariance(a, useUnbiasedEstimate, 0, a.length);
|
double | meanArithmetic(LinkedList mean Arithmetic int n = a.size(); double sum = 0.0; for (int i = 0; i < a.size(); i++) { sum = sum + a.get(i); return sum / n; |
double | meanArray(double[] arr) Method to calculate mean of an array double out = 0.0; for (int i = 0; i < arr.length; i++) out += arr[i]; return out / (1.0 * arr.length); |
double | meandiff(double[] v1, double[] v2) Returns the difference in the means of the two lists. double s1 = 0, c1 = 0; for (int i = 0; i < v1.length; i++) { s1 += v1[i]; c1++; double m1 = s1 / c1; double s2 = 0, c2 = 0; for (int i = 0; i < v2.length; i++) { ... |
double | meanEnt(double[] nums) Return the mean entropy of the logs of the numbers given. return logProb(nums) / nums.length;
|
double | meanFast(final double[] values) mean Fast return sumFast(values) / values.length;
|
float[] | meanFilter(float[] weights, int context) Performs mean filtering of the array. float meanFiltered[] = new float[weights.length]; float mean = 0; for (int i = 0; i < weights.length; i++) { if (i > context / 2) { mean -= weights[i - (context / 2)]; if (i < (weights.length - 1) - (context / 2)) { mean += weights[i + (context / 2)]; ... |
double | meanGreenwichSideralTime(double t) mean Greenwich Sideral Time double theta = 100.46061837 + 36000.770053608 * t + 0.000387933 * (t * t) - (t * t * t) / 38710000; while (theta > 360.0) { theta -= 360.0; while (theta < 0.0) { theta += 360.0; return theta; ... |
float[][] | meanImage(float[][]... images) Calculates the mean of multiple images through each pixel int count = images.length; float[][] mean_float_mat = new float[images[0].length][images[0][0].length]; for (int i = 0; i < images[0].length; i++) { for (int j = 0; j < images[0][0].length; j++) { float sum = 0; for (float[][] float_mat : images) { sum += float_mat[i][j]; mean_float_mat[i][j] = sum / count; return mean_float_mat; |
int | meanLow(final int a, final int b) mean Low return (a & b) + ((a ^ b) >> 1);
|