Package org.jfree.data.function

Examples of org.jfree.data.function.NormalDistributionFunction2D


              final Number min = (Number) nav.where(NumberAnalyzer.DIMENSION_MEASURE,
                  NumberAnalyzer.MEASURE_LOWEST_VALUE).get();
              final Number max = (Number) nav.where(NumberAnalyzer.DIMENSION_MEASURE,
                  NumberAnalyzer.MEASURE_HIGHEST_VALUE).get();

              final NormalDistributionFunction2D normalDistributionFunction = new NormalDistributionFunction2D(
                  mean.doubleValue(), standardDeviation.doubleValue());
              final XYDataset dataset = DatasetUtilities.sampleFunction2D(normalDistributionFunction,
                  min.doubleValue(), max.doubleValue(), 100, "Normal");

              final JFreeChart chart = ChartFactory.createXYLineChart(
View Full Code Here


public class NormalCurve {

    public static XYDataset createDataset(double mu, double sigma)
    {
            NormalDistributionFunction2D normaldistributionfunction2d = new NormalDistributionFunction2D(mu, sigma);
            XYDataset xydataset = DatasetUtilities.sampleFunction2D(normaldistributionfunction2d, mu-2.54*sigma, mu+2.54*sigma, 100, "Normal");
            return xydataset;
    }
View Full Code Here

public class NormalDistribution {

    public static double[][] createChart(Report reportBean) {
      System.out.println(reportBean.getSampleAve());
      System.out.println(reportBean.getStdDeviation());
        NormalDistributionFunction2D normaldistributionfunction2d = new NormalDistributionFunction2D(reportBean.getSampleAve(), reportBean.getStdDeviation());
        XYDataset dataset = DatasetUtilities.sampleFunction2D(normaldistributionfunction2d, reportBean.getSampleAve()-2.54*reportBean.getStdDeviation(), reportBean.getSampleAve()+2.54*reportBean.getStdDeviation(), 100, "Normal");
        int aa = dataset.getItemCount(0);
        double[][] data = new double[aa][2];
        for (int i=0;i<aa;i++) {
          data[i][0] = dataset.getX(0, i).doubleValue();
View Full Code Here

    /**
     * Some tests for the constructor.
     */
    public void testConstructor() {
        NormalDistributionFunction2D f = new NormalDistributionFunction2D(1.0,
                2.0);
        assertEquals(1.0, f.getMean(), EPSILON);
        assertEquals(2.0, f.getStandardDeviation(), EPSILON);
    }
View Full Code Here

    /**
     * For datasets, the equals() method just checks keys and values.
     */
    public void testEquals() {
        NormalDistributionFunction2D f1 = new NormalDistributionFunction2D(1.0,
                2.0);
        NormalDistributionFunction2D f2 = new NormalDistributionFunction2D(1.0,
                2.0);
        assertTrue(f1.equals(f2));
        f1 = new NormalDistributionFunction2D(2.0, 3.0);
        assertFalse(f1.equals(f2));
        f2 = new NormalDistributionFunction2D(2.0, 3.0);
        assertTrue(f1.equals(f2));
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        NormalDistributionFunction2D f1 = new NormalDistributionFunction2D(1.0,
                2.0);
        NormalDistributionFunction2D f2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(f1);
View Full Code Here

    /**
     * Objects that are equal should have the same hash code otherwise FindBugs
     * will tell on us...
     */
    public void testHashCode() {
        NormalDistributionFunction2D f1 = new NormalDistributionFunction2D(1.0,
                2.0);
        NormalDistributionFunction2D f2 = new NormalDistributionFunction2D(1.0,
                2.0);
        assertEquals(f1.hashCode(), f2.hashCode());
    }
View Full Code Here

    /**
     * Some tests for the constructor.
     */
    public void testConstructor() {
        NormalDistributionFunction2D f = new NormalDistributionFunction2D(1.0,
                2.0);
        assertEquals(1.0, f.getMean(), EPSILON);
        assertEquals(2.0, f.getStandardDeviation(), EPSILON);
    }
View Full Code Here

    /**
     * For datasets, the equals() method just checks keys and values.
     */
    public void testEquals() {
        NormalDistributionFunction2D f1 = new NormalDistributionFunction2D(1.0,
                2.0);
        NormalDistributionFunction2D f2 = new NormalDistributionFunction2D(1.0,
                2.0);
        assertTrue(f1.equals(f2));
        f1 = new NormalDistributionFunction2D(2.0, 3.0);
        assertFalse(f1.equals(f2));
        f2 = new NormalDistributionFunction2D(2.0, 3.0);
        assertTrue(f1.equals(f2));
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        NormalDistributionFunction2D f1 = new NormalDistributionFunction2D(1.0,
                2.0);
        NormalDistributionFunction2D f2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(f1);
View Full Code Here

TOP

Related Classes of org.jfree.data.function.NormalDistributionFunction2D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.