romcomma.gsa.models.Sobol§
- class Sobol(gp, kind, m=-1, is_error_calculated=False, **kwargs)[source]§
Bases:
GSA
Class encapsulating a generic Sobol calculation.
- __init__(gp, kind, m=-1, is_error_calculated=False, **kwargs)§
Perform a general GSA. The object created is single use and disposable: the constructor performs and records the entire GSA and the constructed object is basically useless once constructed.
- Parameters:
gp (GPR) – The underlying Gaussian Process.
kind (Kind) – The kind of index to calculate - first order, closed or total.
m (int) – The final index of the reduced model. For a single calculation it is required that
0 &le m < gp.M
. Any m outside this range results the Sobol index of kind being calculated for allm in range(1, M+1)
.is_error_calculated (bool) – Whether to calculate the standard error on the Sobol index. This is a memory intensive calculation, so leave this flag False unless you are sure you need errors
**kwargs (Any) – The calculation meta to override META.
Methods
__init__
(gp, kind[, m, is_error_calculated])Perform a general GSA.
calibrate
([method])Perform a generic GSA calculation.
read_meta
()write_meta
(meta)Attributes
ALL_KINDS
The object to do the calculations, whose marginalise(m) method returns a dict of results.
data
folder
- class Data(folder, **kwargs)[source]§
Bases:
Data
The Data set of a GSA.
- Parameters:
folder (Path | str) –
kwargs (Data.Matrix) –
- static copy(src_folder, dst_folder)§
Returns a copy of
src_folder
at dst_folder, deleting anything existing at the destination.- Parameters:
src_folder (Path | str) –
dst_folder (Path | str) –
- Return type:
Path
- static delete(folder)§
Returns a non-existent
folder
.- Parameters:
folder (Path | str) –
- Return type:
Path
- static empty(folder)§
Returns an empty
folder
.- Parameters:
folder (Path | str) –
- Return type:
Path
- move(dst_folder)§
Move
self
todst_folder
.- Parameters:
dst_folder (Path | str) – The folder to move to. If this exists, it will be emptied.
- Return type:
Returns:
self
for chaining calls.
- classmethod read(folder, **kwargs)§
Read
Data
fromfolder
.- Parameters:
- Return type:
Returns: The
Data
stored infolder
.
- class property META: Dict[str, Any]§
Default calculation meta.
is_T_partial
forcesWmM = 0
.
- property calibrator: ClosedSobol§
The object to do the calculations, whose marginalise(m) method returns a dict of results. :param gp: The GPR underpinning the GSA. :param is_error_calculated: Whether to calculate the standard error of the GSA :param **kwargs: Options passed straight to the Calibrator.
Returns: The Calibrator.
- class Kind(value)§
Bases:
IntEnum
Enum to specify the kind of Sobol index to calculate.
- calibrate(method=None, **kwargs)§
Perform a generic GSA calculation. This method should be overriden by specific subclasses, and called via
super()
as a matter of priority.- Parameters:
method (str | None) – Not used.
- Return type:
Dict[str, Any]
Returns: The results of the calculation, as a labelled dictionary of tf.Tensors.