Example usage for org.apache.commons.math3.distribution NormalDistribution getMean

List of usage examples for org.apache.commons.math3.distribution NormalDistribution getMean

Introduction

In this page you can find the example usage for org.apache.commons.math3.distribution NormalDistribution getMean.

Prototype

public double getMean() 

Source Link

Document

Access the mean.

Usage

From source file:com.wormsim.utils.Utils.java

/**
 * Returns a string representation of the provided distribution. TODO: Make
 * this complete TODO: Make this compatible with custom distributions (or just
 * more complex ones).//  w  w  w .j a v  a 2 s  .c o m
 *
 * @param dist The distribution to translate
 *
 * @return The distribution as a string.
 */
public static String realDistributionToString(RealDistribution dist) {
    if (dist instanceof ConstantRealDistribution) {
        return Double.toString(dist.getNumericalMean());
    } else if (dist instanceof UniformRealDistribution) {
        return "Uniform(" + dist.getSupportLowerBound() + "," + dist.getSupportUpperBound() + ")";
    } else if (dist instanceof NormalDistribution) {
        NormalDistribution dist2 = (NormalDistribution) dist;
        return "Normal(" + dist2.getMean() + "," + dist2.getStandardDeviation() + ")";
    } else {
        return dist.toString();
    }
}