Class ConfidenceInterval

java.lang.Object
org.cloudsimplus.testbeds.ConfidenceInterval

public final class ConfidenceInterval extends Object
Computes the confidence interval for any arbitrary metric from results got from multiple simulation runs.
Since:
CloudSim Plus 6.5.3
Author:
Manoel Campos da Silva Filho
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    The confidence level for computing the CI value (in % from 0 to 1).
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfidenceInterval(org.apache.commons.math3.stat.descriptive.SummaryStatistics stats, String metricName)
    Creates a ConfidenceInterval object with 95% confidence level.
  • Method Summary

    Modifier and Type
    Method
    Description
    errorMargin(org.apache.commons.math3.stat.descriptive.SummaryStatistics stats)
    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.
    double
    Gets the t-Distribution critical value.
    double
    Gets the CI error margin, which defines the size of the interval in which results may lay between.
    double
    Gets the lower limit of the Confidence Interval, based on the getErrorMargin().
    Gets the name of the metric for which the Confidence Interval is computed.
    long
    Gets the number of samples used to compute the Confidence Interval.
    double
     
    double
    Gets the upper limit of the Confidence Interval, based on the getErrorMargin().
    double
    Gets the Confidence Interval value, which is the mean value for an arbitrary metric from multiple simulation runs.
    boolean
    Check if the CI was actually computed, if the number of samples is greater than 1.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CONFIDENCE_LEVEL

      public static final double CONFIDENCE_LEVEL
      The confidence level for computing the CI value (in % from 0 to 1).
      See Also:
  • Constructor Details

    • ConfidenceInterval

      public ConfidenceInterval(org.apache.commons.math3.stat.descriptive.SummaryStatistics stats, String metricName)
      Creates a ConfidenceInterval object with 95% confidence level.
      Parameters:
      stats - the object containing the statistics for the arbitrary metric collected
      metricName -
  • Method Details

    • errorMargin

      public static Optional<Double> errorMargin(org.apache.commons.math3.stat.descriptive.SummaryStatistics stats)
      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.

      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, batch means or regenerative method has to be used.

      NOTE: How to compute the error margin is a little 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 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.
      Parameters:
      stats - the statistic object with the values to compute the error margin of the confidence interval
      Returns:
      the error margin to compute the lower and upper bound of the confidence interval
      See Also:
    • getValue

      public double getValue()
      Gets the Confidence Interval value, which is the mean value for an arbitrary metric from multiple simulation runs. This value is usually referred as just CI.
      See Also:
    • getStdDev

      public double getStdDev()
    • getSamples

      public long getSamples()
      Gets the number of samples used to compute the Confidence Interval.
    • getCriticalValue

      public double getCriticalValue()
      Gets the t-Distribution critical value.
    • getErrorMargin

      public double getErrorMargin()
      Gets the CI error margin, which defines the size of the interval in which results may lay between. The interval is between getLowerLimit() and getUpperLimit().
    • getLowerLimit

      public double getLowerLimit()
      Gets the lower limit of the Confidence Interval, based on the getErrorMargin().
    • getUpperLimit

      public double getUpperLimit()
      Gets the upper limit of the Confidence Interval, based on the getErrorMargin().
    • getMetricName

      public String getMetricName()
      Gets the name of the metric for which the Confidence Interval is computed.
    • isComputed

      public boolean isComputed()
      Check if the CI was actually computed, if the number of samples is greater than 1. Otherwise, the CI value is just the mean for the experiment metric, not the CI in fact. In that case, criticalValue, errorMargin, lowerLimit and upperLimit will be zero (corroborating there is no CI).
      Returns: