papaya
Class Descriptive.Pooled

java.lang.Object
  extended by papaya.Descriptive.Pooled
Enclosing class:
Descriptive

public static class Descriptive.Pooled
extends Object

Class for computing the pooled mean and variance of data sequences


Method Summary
static float mean(float[] means, int[] sizes)
          Returns the pooled mean of a k data sequences.
static float mean(float mean1, int size1, float mean2, int size2)
          Returns the pooled mean of two data sequences.
static float var(float[] variances, int[] sizes, boolean unbiased)
          Returns the pooled variance of k data sequences.
static float var(float variance1, int size1, float variance2, int size2, boolean unbiased)
          Returns the pooled variance of two data sequences.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mean

public static float mean(float mean1,
                         int size1,
                         float mean2,
                         int size2)
Returns the pooled mean of two data sequences. That is (size1 * mean1 + size2 * mean2) / (size1 + size2).

Parameters:
size1 - the number of elements in data sequence 1.
mean1 - the mean of data sequence 1.
size2 - the number of elements in data sequence 2.
mean2 - the mean of data sequence 2.

mean

public static float mean(float[] means,
                         int[] sizes)
Returns the pooled mean of a k data sequences. That is (size1 * mean1 + size2 * mean1 + ... + sizek * meank) / (size1 + size2 + ... + sizek).


var

public static float var(float variance1,
                        int size1,
                        float variance2,
                        int size2,
                        boolean unbiased)
Returns the pooled variance of two data sequences. The unbiased estimate of the pooled variance is computed as
 unbiasedPooledVar = Sum( (size_i -1)*variance_i ) / Sum( (size_i-1) ),
 
while the biased pooled variance is computed using
 biasedPooledVar = Sum( (size_i)*variance_i ) / Sum(size_i),
 
 For more than 2 datasets, use var(float[],int[],boolean).

Parameters:
size1 - the number of elements in data sequence 1.
variance1 - the variance of data sequence 1.
size2 - the number of elements in data sequence 2.
variance2 - the variance of data sequence 2.
unbiased - set to true to return the unbiased pooled variance, false to return the biased version.

var

public static float var(float[] variances,
                        int[] sizes,
                        boolean unbiased)
Returns the pooled variance of k data sequences. The unbiased estimate of the pooled variance is computed as
 unbiasedPooledVar = Sum( (sizes[i] -1)*variances[i] ) / Sum( (sizes[i]-1) ),
 
while the biased pooled variance is computed using
 biasedPooledVar = Sum( (sizes[i])*variances[i] ) / Sum(sizes[i]),



Processing library papaya by Adila Faruk. (C) 2014