Class SNDiagnosticExperiment


  • public class SNDiagnosticExperiment
    extends java.lang.Object
    Use the static create method to get a builder to builder the experiment with its addFactor data.

    Input uncertainty analyzer based on :

    Song, E., and Nelson, B. L. (n.d.). Quickly assessing contributions to input uncertainty. IIE Transactions. http://doi.org/10.1080/0740817X.2014.980869

    • Method Detail

      • runDiagnosticExperiment

        public void runDiagnosticExperiment​(int numBootstrapSamples,
                                            int numReplications)
        Uses common random numbers across simulation runs
        Parameters:
        numBootstrapSamples - the number of bootstrap samples to make for each input distribution
        numReplications - the number of replications in the diagnostic experiment
      • runDiagnosticExperiment

        public void runDiagnosticExperiment​(int numBootstrapSamples,
                                            int numReplications,
                                            boolean useCRN)
        Parameters:
        useCRN - , if true the stream for every random variable is the same across the bootstraps to facilitate common random number generation (CRN). If false different streams are used for each created random variable. Each factor gets its own unique stream regardless.
        numBootstrapSamples - the number of bootstrap samples to make for each input distribution
        numReplications - the number of replications in the diagnostic experiment
      • getNumBootstrapSamples

        public final int getNumBootstrapSamples()
        Returns:
        the number of bootstrap samples specified in the experiment
      • getNumReplications

        public final int getNumReplications()
        Returns:
        the number of replications specified in the experiment
      • getTotalInputUncertainty

        public final double getTotalInputUncertainty()
        Returns:
        the total input uncertainty across factors
      • getRelativeSignificanceRatio

        public final double getRelativeSignificanceRatio​(double stdError)
        The relative significance of input uncertainty to simulation estimator variability. This is gamma of step 4, page 899 of Song and Nelson
        Parameters:
        stdError - the standard error of the simulation estimator
        Returns:
        the relative significance estimate
      • getInputUncertaintyContribution

        public final double getInputUncertaintyContribution​(java.lang.String factor)
        Parameters:
        factor - the name of the addFactor
        Returns:
        the input uncertainty for the named addFactor
      • getRelativeInputUncertaintyContribution

        public final double getRelativeInputUncertaintyContribution​(java.lang.String factor)
        Parameters:
        factor - the name of the addFactor
        Returns:
        the relative input uncertainty for the named addFactor
      • getFactorOutputData

        public java.util.Map<java.lang.String,​SNDiagnosticExperiment.FactorOutputData> getFactorOutputData()
        There will not be any addFactor output data until the diagnostic experiment is run
        Returns:
        an unmodifiable map of the addFactor output data
      • getFittedRegression

        public java.util.Optional<org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression> getFittedRegression()
        Returns:
        the fitted regression, it will be null if not fitted yet
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • asString

        public java.lang.String asString()
      • main

        public static void main​(java.lang.String[] args)
      • test1

        public static void test1()
      • test2

        public static void test2()
      • test3

        public static void test3()
      • test4

        public static void test4()