Package jslx.statistics
Class SNDiagnosticExperiment
- java.lang.Object
-
- jslx.statistics.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SNDiagnosticExperiment.AddFactorDataStepIfc
Adding addFactor data stepstatic class
SNDiagnosticExperiment.Builder
A builder for creating SNDiagnosticExperimentstatic interface
SNDiagnosticExperiment.BuildStepIfc
The ability to builder or add addFactor datastatic class
SNDiagnosticExperiment.FactorInputData
A Factor Input Data class to hold the data needed by the SNDiagnosticExperimentstatic class
SNDiagnosticExperiment.FactorOutputData
A addFactor output data class to hold data produced for each addFactor by the SNDiagnosticExperimentstatic class
SNDiagnosticExperiment.SimRunner1
static class
SNDiagnosticExperiment.SimRunner2
static class
SNDiagnosticExperiment.SimRunner3
static class
SNDiagnosticExperiment.StochasticActivityNetwork
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
static SNDiagnosticExperiment.AddFactorDataStepIfc
create(SNReplicationRunnerIfc sim)
java.util.Map<java.lang.String,SNDiagnosticExperiment.FactorInputData>
getFactorInputData()
java.util.Map<java.lang.String,SNDiagnosticExperiment.FactorOutputData>
getFactorOutputData()
There will not be any addFactor output data until the diagnostic experiment is runjava.util.Optional<org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression>
getFittedRegression()
double
getInputUncertaintyContribution(java.lang.String factor)
int
getNumBootstrapSamples()
int
getNumReplications()
double
getRelativeInputUncertaintyContribution(java.lang.String factor)
double
getRelativeSignificanceRatio(double stdError)
The relative significance of input uncertainty to simulation estimator variability.double
getTotalInputUncertainty()
static void
main(java.lang.String[] args)
void
runDiagnosticExperiment(int numBootstrapSamples, int numReplications)
Uses common random numbers across simulation runsvoid
runDiagnosticExperiment(int numBootstrapSamples, int numReplications, boolean useCRN)
static void
test1()
static void
test2()
static void
test3()
static void
test4()
java.lang.String
toString()
-
-
-
Method Detail
-
create
public static final SNDiagnosticExperiment.AddFactorDataStepIfc create(SNReplicationRunnerIfc sim)
- Parameters:
sim
- a reference to something that can run the simulation- Returns:
-
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 distributionnumReplications
- 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 distributionnumReplications
- 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
-
getFactorInputData
public java.util.Map<java.lang.String,SNDiagnosticExperiment.FactorInputData> getFactorInputData()
- Returns:
- an unmodifiable map of the addFactor input data
-
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 classjava.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()
-
-