Base class for common code between NonDLHSSampling, NonDIncremLHSSampling, and NonDAdaptImpSampling. More...
Public Member Functions | |
void | moments (const RealVector &means, const RealVector &std_devs) |
set meanStats and stdDevStats | |
void | compute_distribution_mappings (const ResponseArray &samples) |
called by compute_statistics() to calculate CDF/CCDF mappings of z to p/beta and of p/beta to z | |
void | update_final_statistics () |
update finalStatistics from minValues/maxValues, meanStats/stdDevStats, and computedProbLevels/computedRelLevels/computedRespLevels | |
Protected Member Functions | |
NonDSampling (Model &model) | |
constructor | |
NonDSampling (NoDBBaseConstructor, Model &model, const String &sample_type, int samples, int seed, const String &rng) | |
alternate constructor for sample generation and evaluation "on the fly" | |
NonDSampling (NoDBBaseConstructor, const String &sample_type, int samples, int seed, const String &rng, const RealVector &lower_bnds, const RealVector &upper_bnds) | |
alternate constructor for sample generation "on the fly" | |
~NonDSampling () | |
destructor | |
int | num_samples () const |
get the current number of samples | |
void | sampling_reset (int min_samples, bool all_data_flag, bool stats_flag) |
resets number of samples and sampling flags | |
const String & | sampling_scheme () const |
return sampleType: "lhs" or "random" | |
void | vary_pattern (bool pattern_flag) |
set varyPattern | |
void | get_parameter_sets (Model &model) |
Uses lhsDriver to generate a set of samples from the distributions/bounds defined in the incoming model. | |
void | get_parameter_sets (const RealVector &lower_bnds, const RealVector &upper_bnds) |
Uses lhsDriver to generate a set of uniform samples over lower_bnds/upper_bnds. | |
void | update_model_from_sample (Model &model, const Real *sample_vars) |
Override default update of continuous vars only. | |
void | initialize_lhs (bool write_message) |
increments numLHSRuns, sets random seed, and initializes lhsDriver | |
void | compute_statistics (const RealMatrix &vars_samples, const ResponseArray &resp_samples) |
For the input sample set, computes mean, standard deviation, and probability/reliability/response levels (aleatory uncertainties) or intervals (epsitemic or mixed uncertainties) | |
void | compute_intervals (const ResponseArray &samples) |
called by compute_statistics() to calculate min/max intervals | |
void | compute_moments (const ResponseArray &samples) |
called by compute_statistics() to calculate means, std deviations, and confidence intervals | |
void | print_statistics (std::ostream &s) const |
prints the statistics computed in compute_statistics() | |
void | print_intervals (std::ostream &s) const |
prints the intervals computed in compute_intervals() | |
void | print_moments (std::ostream &s) const |
prints the moments computed in compute_moments() | |
void | view_counts (const Model &model, size_t &cv_start, size_t &num_cv, size_t &div_start, size_t &num_div, size_t &drv_start, size_t &num_drv) const |
compute sampled subsets of all cv/div/drv from samplingVarsMode and model | |
Protected Attributes | |
const int | seedSpec |
the user seed specification (default is 0) | |
int | randomSeed |
the current seed | |
const int | samplesSpec |
initial specification of number of samples | |
int | numSamples |
the current number of samples to evaluate | |
String | rngName |
name of the random number generator | |
String | sampleType |
the sample type: random, lhs, or incremental_lhs | |
Pecos::LHSDriver | lhsDriver |
the C++ wrapper for the F90 LHS library | |
bool | statsFlag |
flags computation/output of statistics | |
bool | allDataFlag |
flags update of allResponses < (allVariables or allSamples already defined) | |
short | samplingVarsMode |
the sampling mode: ACTIVE, ACTIVE_UNIFORM, ALL, or ALL_UNIFORM | |
short | sampleRanksMode |
mode for input/output of LHS sample ranks: IGNORE_RANKS, GET_RANKS, SET_RANKS, or SET_GET_RANKS | |
bool | varyPattern |
flag for generating a sequence of seed values within multiple get_parameter_sets() calls so that these executions (e.g., for SBO/SBNLS) are not repeated, but are still repeatable | |
RealMatrix | sampleRanks |
data structure to hold the sample ranks | |
RealVector | mean95CIDeltas |
Plus/minus deltas on response function means for 95% confidence intervals (calculated in compute_moments()) | |
RealVector | stdDev95CILowerBnds |
Lower bound for 95% confidence interval on std deviation (calculated in compute_moments()) | |
RealVector | stdDev95CIUpperBnds |
Upper bound for 95% confidence interval on std deviation (calculated in compute_moments()) | |
SensAnalysisGlobal | nonDSampCorr |
initialize statistical post processing | |
Private Attributes | |
size_t | numLHSRuns |
counter for number of executions of get_parameter_sets() for this object | |
RealVector | meanStats |
means of response functions (calculated in compute_moments()) | |
RealVector | stdDevStats |
std deviations of response functions (calculated in compute_moments()) | |
RealVector | skewnessStats |
skewness of response functions (calculated in compute_moments()) | |
RealVector | kurtosisStats |
kurtosis of response functions (calculated in compute_moments()) | |
RealVector | minValues |
Min values of response functions for epistemic calculations (calculated in compute_intervals()) | |
RealVector | maxValues |
Max values of response functions for epistemic calculations (calculated in compute_intervals()) |
Base class for common code between NonDLHSSampling, NonDIncremLHSSampling, and NonDAdaptImpSampling.
This base class provides common code for sampling methods which employ the Latin Hypercube Sampling (LHS) package from Sandia Albuquerque's Risk and Reliability organization. NonDSampling now exclusively utilizes the 1998 Fortran 90 LHS version as documented in SAND98-0210, which was converted to a UNIX link library in 2001. The 1970's vintage LHS (that had been f2c'd and converted to incomplete classes) has been removed.
NonDSampling | ( | Model & | model | ) | [protected] |
constructor
This constructor is called for a standard letter-envelope iterator instantiation. In this case, set_db_list_nodes has been called and probDescDB can be queried for settings from the method specification.
References Dakota::abort_handler(), NonD::initialize_final_statistics(), Iterator::maxConcurrency, NonD::numEpistemicUncVars, NonDSampling::numSamples, NonDSampling::sampleType, and NonD::totalLevelRequests.
NonDSampling | ( | NoDBBaseConstructor | , |
Model & | model, | ||
const String & | sample_type, | ||
int | samples, | ||
int | seed, | ||
const String & | rng | ||
) | [protected] |
alternate constructor for sample generation and evaluation "on the fly"
This alternate constructor is used for generation and evaluation of on-the-fly sample sets.
References Iterator::maxConcurrency, NonDSampling::numSamples, NonDSampling::sampleType, and Iterator::subIteratorFlag.
NonDSampling | ( | NoDBBaseConstructor | , |
const String & | sample_type, | ||
int | samples, | ||
int | seed, | ||
const String & | rng, | ||
const RealVector & | lower_bnds, | ||
const RealVector & | upper_bnds | ||
) | [protected] |
alternate constructor for sample generation "on the fly"
This alternate constructor is used by ConcurrentStrategy for generation of uniform, uncorrelated sample sets.
References Iterator::maxConcurrency, NonDSampling::numSamples, NonDSampling::sampleType, and Iterator::subIteratorFlag.
int num_samples | ( | ) | const [inline, protected, virtual] |
get the current number of samples
Return current number of evaluation points. Since the calculation of samples, collocation points, etc. might be costly, provide a default implementation here that backs out from the maxConcurrency. May be (is) overridden by derived classes.
Reimplemented from Iterator.
References NonDSampling::numSamples.
Referenced by NonDAdaptImpSampling::generate_samples(), NonDAdaptImpSampling::select_init_rep_points(), and NonDAdaptImpSampling::select_rep_points().
void sampling_reset | ( | int | min_samples, |
bool | all_data_flag, | ||
bool | stats_flag | ||
) | [inline, protected, virtual] |
resets number of samples and sampling flags
used by DataFitSurrModel::build_global() to publish the minimum number of samples needed from the sampling routine (to build a particular global approximation) and to set allDataFlag and statsFlag. In this case, allDataFlag is set to true (vectors of variable and response sets must be returned to build the global approximation) and statsFlag is set to false (statistics computations are not needed).
Reimplemented from Iterator.
References NonDSampling::allDataFlag, NonDSampling::numSamples, NonDSampling::samplesSpec, and NonDSampling::statsFlag.
void get_parameter_sets | ( | Model & | model | ) | [protected, virtual] |
Uses lhsDriver to generate a set of samples from the distributions/bounds defined in the incoming model.
This version of get_parameter_sets() extracts data from the user-defined model in any of the four sampling modes.
Reimplemented from Analyzer.
References Model::all_continuous_lower_bounds(), Model::all_continuous_upper_bounds(), Model::all_discrete_int_lower_bounds(), Model::all_discrete_int_upper_bounds(), Analyzer::allSamples, Model::continuous_lower_bounds(), Model::continuous_upper_bounds(), Model::current_variables(), Model::discrete_design_set_int_values(), Model::discrete_design_set_real_values(), Model::discrete_int_lower_bounds(), Model::discrete_int_upper_bounds(), Model::discrete_state_set_int_values(), Model::discrete_state_set_real_values(), Model::distribution_parameters(), NonDSampling::initialize_lhs(), NonDSampling::lhsDriver, NonD::numContAleatUncVars, NonD::numContDesVars, NonD::numContEpistUncVars, NonD::numContStateVars, NonD::numDiscIntAleatUncVars, NonD::numDiscIntDesVars, NonD::numDiscIntEpistUncVars, NonD::numDiscIntStateVars, NonDSampling::numSamples, NonDSampling::sampleRanks, NonDSampling::samplingVarsMode, and Variables::view().
Referenced by NonDLHSSampling::NonDLHSSampling(), NonDLHSSampling::pre_run(), NonDIncremLHSSampling::quantify_uncertainty(), and NonDAdaptImpSampling::quantify_uncertainty().
void get_parameter_sets | ( | const RealVector & | lower_bnds, |
const RealVector & | upper_bnds | ||
) | [protected] |
Uses lhsDriver to generate a set of uniform samples over lower_bnds/upper_bnds.
This version of get_parameter_sets() does not extract data from the user-defined model, but instead relies on the incoming bounded region definition. It only support a UNIFORM sampling mode, where the distinction of ACTIVE_UNIFORM vs. ALL_UNIFORM is handled elsewhere.
References Analyzer::allSamples, NonDSampling::initialize_lhs(), NonDSampling::lhsDriver, and NonDSampling::numSamples.