pygcam.mcs.sensitivity
¶
Functions for performing sampling and sensitivity analysis.
The main features of this module are:
- The
SensitivityAnalysis
class, which provides a uniform interface to the various sampling and sensitivity analysis methods implemented in SALib. - The
data.sa
directory “package” (managed by theSensitivityAnalysis
class) which stores sampled data and information about the sampling method required by the analysis methods.
Access to these features is provided via the -m
/ --method
argument
to the gensim sub-command.
API¶
-
class
pygcam.mcs.sensitivity.
DGSM
(pkgPath, problemFile=None, inputsFile=None, resultsFile=None)¶ Provides an interface to SALib’s Derivative-based Global Sensitivity Measure (DGSM) sampling and analysis methods.
-
class
pygcam.mcs.sensitivity.
Delta
(pkgPath, problemFile=None, inputsFile=None, resultsFile=None)¶ Provides an interface to SALib’s Delta moment-independent measure sampling and analysis methods.
-
class
pygcam.mcs.sensitivity.
FAST
(pkgPath, problemFile=None, inputsFile=None, resultsFile=None)¶ Provides an interface to SALib’s Fourier Amplitude Sensitivity Test (FAST) sampling and analysis methods.
-
class
pygcam.mcs.sensitivity.
LatinSampler
(pkgPath, analyzeFn=None, problemFile=None, inputsFile=None, resultsFile=None)¶
-
class
pygcam.mcs.sensitivity.
MonteCarlo
(pkgPath, problemFile=None, inputsFile=None, resultsFile=None)¶
-
class
pygcam.mcs.sensitivity.
Morris
(pkgPath, problemFile=None, inputsFile=None, resultsFile=None, groupsFile=None)¶ Provides an interface to SALib’s Method of Morris sampling and analysis methods.
-
exception
pygcam.mcs.sensitivity.
SAException
¶
-
class
pygcam.mcs.sensitivity.
SensitivityAnalysis
(pkgPath, problemFile=None, inputsFile=None, resultsFile=None)¶ Abstract superclass for Sensitivity Analysis methods from SALib. Stores sets of method name and args, parameter descriptions, samples, and model results in a directory “package” with an “.sa” extension. Ensures that analysis methods are called with the same arguments used to produce the samples.
-
loadResults
(resultName, resultsFile=None, sep=', ')¶ Load model results from a CSV file.
Parameters: - resultName – (str) the name of the model output
- resultsFile – (str) the path of the results file
- sep – (str) column separator
Returns: (pandas.DataFrame) contents of the results file
-
predictN
(trials, calcSecondOrder=False)¶ Computes the value of N required to produce the given number of samples, per SA method.
Parameters: - trials – (int) the number of total samples desired
- calcSecondOrder – (bool) whether to calculate second-order sensitivity indices (for Sobol method only).
Returns: (int) the value of N to use to produce trials
-
-
class
pygcam.mcs.sensitivity.
Sobol
(pkgPath, problemFile=None, inputsFile=None, resultsFile=None)¶ Provides an interface to SALib’s Sobol Sensitivity sampling and analysis methods.