Example usage for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getWindowSize

List of usage examples for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getWindowSize

Introduction

In this page you can find the example usage for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getWindowSize.

Prototype

public int getWindowSize() 

Source Link

Document

Returns the maximum number of values that can be stored in the dataset, or INFINITE_WINDOW (-1) if there is no limit.

Usage

From source file:com.intuit.tank.persistence.databases.BucketDataItemTest.java

/**
 * Run the DescriptiveStatistics getStats() method test.
 * /*from  w  w  w. j  a v  a 2s. c  om*/
 * @throws Exception
 * 
 * @generatedBy CodePro at 9/10/14 10:32 AM
 */
@Test
public void testGetStats_1() throws Exception {
    BucketDataItem fixture = new BucketDataItem(1, new Date(), new DescriptiveStatistics());

    DescriptiveStatistics result = fixture.getStats();

    assertNotNull(result);
    assertEquals(
            "DescriptiveStatistics:\nn: 0\nmin: NaN\nmax: NaN\nmean: NaN\nstd dev: NaN\nmedian: NaN\nskewness: NaN\nkurtosis: NaN\n",
            result.toString());
    assertEquals(Double.NaN, result.getMax(), 1.0);
    assertEquals(Double.NaN, result.getVariance(), 1.0);
    assertEquals(Double.NaN, result.getMean(), 1.0);
    assertEquals(-1, result.getWindowSize());
    assertEquals(0.0, result.getSumsq(), 1.0);
    assertEquals(Double.NaN, result.getKurtosis(), 1.0);
    assertEquals(0.0, result.getSum(), 1.0);
    assertEquals(Double.NaN, result.getSkewness(), 1.0);
    assertEquals(Double.NaN, result.getPopulationVariance(), 1.0);
    assertEquals(Double.NaN, result.getStandardDeviation(), 1.0);
    assertEquals(Double.NaN, result.getGeometricMean(), 1.0);
    assertEquals(0L, result.getN());
    assertEquals(Double.NaN, result.getMin(), 1.0);
}