cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-testbeds/src/main/java/org/cloudsimplus/testbeds/ExperimentRunner.java
protected double computeConfidenceErrorMargin(SummaryStatistics stats, double confidenceLevel) {
        try {
            // Creates a T-Distribution with N-1 degrees of freedom
            final double degreesOfFreedom = stats.getN() - 1;

            /*
		    The t-Distribution is used to determine the probability that
		    the real population mean lies in a given interval.
             */
            final TDistribution tDist = new TDistribution(degreesOfFreedom);
            final double significance = 1.0 - confidenceLevel;
            final double criticalValue = tDist.inverseCumulativeProbability(1.0 - significance / 2.0);
            System.out.printf("\n\tt-Distribution critical value for %d samples: %f\n", stats.getN(), criticalValue);

            // Calculates the confidence interval error margin
            return criticalValue * stats.getStandardDeviation() / Math.sqrt(stats.getN());
        } catch (MathIllegalArgumentException e) {
            return Double.NaN;
        }
    }
/**
     * <p>
     * Computes the confidence interval error margin for a given set of samples
     * in order to enable finding the interval lower and upper bound around a
     * mean value. By this way, the confidence interval can be computed as [mean
     * + errorMargin .. mean - errorMargin].
     * </p>
     *
     * <p>
     * To reduce the confidence interval by half, one have to execute the
     * experiments 4 more times. This is called the "Replication Method" and
     * just works when the samples are i.i.d. (independent and identically
     * distributed). Thus, if you have correlation between samples of each
     * simulation run, a different method such as a bias compensation,
     * {@link #isApplyBatchMeansMethod() batch means} or regenerative method has
     * to be used. </p>
     *
     * <b>NOTE:</b> How to compute the error margin is a little bit confusing.
     * The Harry Perros' book states that if less than 30 samples are collected,
     * the t-Distribution has to be used to that purpose.
     *
     * However, this article
     * <a href="https://en.wikipedia.org/wiki/Confidence_interval#Basic_Steps">Wikipedia
     * article</a>
     * says that if the standard deviation of the real population is known, it
     * has to be used the z-value from the Standard Normal Distribution.
     * Otherwise, it has to be used the t-value from the t-Distribution to
     * calculate the critical value for defining the error margin (also called
     * standard error). The book "Numeric Computation and Statistical Data
     * Analysis on the Java Platform" confirms the last statement and such
     * approach was followed.
     *
     * @param stats the statistic object with the values to compute the error
     * margin of the confidence interval
     * @param confidenceLevel the confidence level, in the interval from ]0 to
     * 1[, such as 0.95 to indicate 95% of confidence.
     * @return the error margin to compute the lower and upper bound of the
     * confidence interval
     *
     * @see
     * <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm">Critical
     * Values of the Student's t Distribution</a>
     * @see
     * <a href="https://en.wikipedia.org/wiki/Student%27s_t-distribution">t-Distribution</a>
     * @see <a href="http://www4.ncsu.edu/~hp/files/simulation.pdf">Harry
     * Perros, "Computer Simulation Techniques: The definitive introduction!,"
     * 2009</a>
     * @see <a href="http://www.springer.com/gp/book/9783319285290">Numeric
     * Computation and Statistical Data Analysis on the Java Platform</a>
     */

Computes the confidence interval error margin for a given set of samples
in order to enable finding the interval lower and upper bound around a
mean value. By this way, the confidence interval can be computed as [mean
+ errorMargin .. mean - errorMargin].


To reduce the confidence interval by half, one have to execute the
experiments 4 more times. This is called the "Replication Method" and
just works when the samples are i.i.d. (independent and identically
distributed). Thus, if you have correlation between samples of each
simulation run, a different method such as a bias compensation,
#isApplyBatchMeansMethod() batch means or regenerative method has
to be used.

NOTE: How to compute the error margin is a little bit confusing.
The Harry Perros' book states that if less than 30 samples are collected,
the t-Distribution has to be used to that purpose.

However, this article
Wikipedia
article
says that if the standard deviation of the real population is known, it
has to be used the z-value from the Standard Normal Distribution.
Otherwise, it has to be used the t-value from the t-Distribution to
calculate the critical value for defining the error margin (also called
standard error). The book "Numeric Computation and Statistical Data
Analysis on the Java Platform" confirms the last statement and such
approach was followed.

@param stats the statistic object with the values to compute the error
margin of the confidence interval
@param confidenceLevel the confidence level, in the interval from ]0 to
1[, such as 0.95 to indicate 95% of confidence.
@return the error margin to compute the lower and upper bound of the
confidence interval

@see
Critical
Values of the Student's t Distribution
@see
t-Distribution
@see Harry
Perros, "Computer Simulation Techniques: The definitive introduction!,"
2009
@see Numeric
Computation and Statistical Data Analysis on the Java Platform
Computes the confidence interval error margin for a given set of samples in order to enable finding the interval lower and upper bound around a mean value . By this way the confidence interval can be computed as [ mean + errorMargin .. mean - errorMargin ] . To reduce the confidence interval by half one have to execute the experiments 4 more times . This is called the " Replication Method " and just works when the samples are i . i . d . ( independent and identically distributed ) . Thus if you have correlation between samples of each simulation run a different method such as a bias compensation #isApplyBatchMeansMethod () batch means or regenerative method has to be used . NOTE : How to compute the error margin is a little bit confusing . The Harry Perros ' book states that if less than 30 samples are collected the t - Distribution has to be used to that purpose . However this article Wikipedia article says that if the standard deviation of the real population is known it has to be used the z - value from the Standard Normal Distribution . Otherwise it has to be used the t - value from the t - Distribution to calculate the critical value for defining the error margin ( also called standard error ) . The book " Numeric Computation and Statistical Data Analysis on the Java Platform " confirms the last statement and such approach was followed . @param stats the statistic object with the values to compute the error margin of the confidence interval @param confidenceLevel the confidence level in the interval from ] 0 to 1 [ such as 0 . 95 to indicate 95% of confidence . @return the error margin to compute the lower and upper bound of the confidence interval @see Critical Values of the Student ' s t Distribution @see t - Distribution @see Harry Perros " Computer Simulation Techniques : The definitive introduction! " 2009 @see Numeric Computation and Statistical Data Analysis on the Java Platform
protected double computeConfidenceErrorMargin(SummaryStatistics stats, double confidenceLevel) {
        try {
            final double degreesOfFreedom = stats.getN() - 1;
            /*
		    The t-Distribution is used to determine the probability that
		    the real population mean lies in a given interval.
             */
            final TDistribution tDist = new TDistribution(degreesOfFreedom);
            final double significance = 1.0 - confidenceLevel;
            final double criticalValue = tDist.inverseCumulativeProbability(1.0 - significance / 2.0);
            System.out.printf("\n\tt-Distribution critical value for %d samples: %f\n", stats.getN(), criticalValue);
            return criticalValue * stats.getStandardDeviation() / Math.sqrt(stats.getN());
        } catch (MathIllegalArgumentException e) {
            return Double.NaN;
        }
    }
protected double computeConfidenceErrorMargin ( SummaryStatistics stats , double confidenceLevel ) { try { final double degreesOfFreedom = stats . getN ( ) - 1 ; /*
		    The t-Distribution is used to determine the probability that
		    the real population mean lies in a given interval.
             */ final TDistribution tDist = new TDistribution ( degreesOfFreedom ) ; final double significance = 1.0 - confidenceLevel ; final double criticalValue = tDist . inverseCumulativeProbability ( 1.0 - significance / 2.0 ) ; System . out . printf ( "\n\tt-Distribution critical value for %d samples: %f\n" , stats . getN ( ) , criticalValue ) ; return criticalValue * stats . getStandardDeviation ( ) / Math . sqrt ( stats . getN ( ) ) ; } catch ( MathIllegalArgumentException e ) { return Double . NaN ; } }
<p>
 Computes the confidence interval error margin for a given set of samples
 in order to enable finding the interval lower and upper bound around a
 mean value.
<p > Computes the confidence interval error margin for a given set of samples in order to enable finding the interval lower and upper bound around a mean value .
// Creates a T-Distribution with N-1 degrees of freedom // Calculates the confidence interval error margin