Base class for NonD, DACE, and ParamStudy branches of the iterator hierarchy. More...
Public Member Functions | |
const VariablesArray & | all_variables () |
return the complete set of evaluated variables | |
const RealMatrix & | all_samples () |
return the complete set of evaluated samples | |
const ResponseArray & | all_responses () const |
return the complete set of computed responses | |
Protected Member Functions | |
Analyzer () | |
default constructor | |
Analyzer (Model &model) | |
standard constructor | |
Analyzer (NoDBBaseConstructor, Model &model) | |
alternate constructor for instantiations "on the fly" with a Model | |
Analyzer (NoDBBaseConstructor) | |
alternate constructor for instantiations "on the fly" without a Model | |
~Analyzer () | |
destructor | |
virtual void | vary_pattern (bool pattern_flag) |
sets varyPattern in derived classes that support it | |
virtual void | get_parameter_sets (Model &model) |
Returns one block of samples (ndim * num_samples) | |
virtual void | update_model_from_sample (Model &model, const Real *sample_vars) |
update model's current variables with data from sample | |
virtual void | update_model_from_variables (Model &model, const Variables &vars) |
update model's current variables with data from vars | |
void | pre_output () |
convenience function to write variables to file, following pre-run | |
void | print_results (std::ostream &s) |
print the final iterator results | |
const Variables & | variables_results () const |
return a single final iterator solution (variables) | |
const Response & | response_results () const |
return a single final iterator solution (response) | |
const VariablesArray & | variables_array_results () |
return multiple final iterator solutions (variables). This should only be used if returns_multiple_points() returns true. | |
const ResponseArray & | response_array_results () |
return multiple final iterator solutions (response). This should only be used if returns_multiple_points() returns true. | |
void | response_results_active_set (const ActiveSet &set) |
set the requested data for the final iterator response results | |
bool | compact_mode () const |
returns Analyzer::compactMode | |
bool | returns_multiple_points () const |
indicates if this iterator returns multiple final points. Default return is false. Override to return true if appropriate. | |
void | evaluate_parameter_sets (Model &model, bool log_resp_flag, bool log_best_flag) |
perform function evaluations to map parameter sets (allVariables) into response sets (allResponses) | |
void | variance_based_decomp (int ncont, int ndiscint, int ndiscreal, int num_samples) |
void | read_variables_responses (int num_evals, size_t num_vars) |
convenience function for reading variables/responses (used in derived classes post_input) | |
void | print_sobol_indices (std::ostream &s) const |
Printing of VBD results. | |
void | sample_to_variables (const Real *sample_c_vars, Variables &vars) |
convert samples array to variables array; e.g., allSamples to allVariables | |
void | samples_to_variables_array (const RealMatrix &sample_matrix, VariablesArray &vars_array) |
convert samples array to variables array; e.g., allSamples to allVariables | |
void | variables_array_to_samples (const VariablesArray &vars_array, RealMatrix &sample_matrix) |
convert variables array to samples array; e.g., allVariables to allSamples | |
Protected Attributes | |
bool | compactMode |
switch for allSamples (compact mode) instead of allVariables (normal mode) | |
VariablesArray | allVariables |
array of all variables to be evaluated in evaluate_parameter_sets() | |
RealMatrix | allSamples |
compact alternative to allVariables | |
ResponseArray | allResponses |
array of all responses to be computed in evaluate_parameter_sets() | |
StringArray | allHeaders |
array of headers to insert into output while evaluating allVariables | |
size_t | numObjFns |
number of objective functions | |
size_t | numLSqTerms |
number of least squares terms | |
RealPairPRPMultiMap | bestVarsRespMap |
map which stores best set of solutions | |
Private Member Functions | |
void | compute_best_metrics (const Response &response, std::pair< Real, Real > &metrics) |
compares current evaluation to best evaluation and updates best | |
void | update_best (const Variables &vars, int eval_id, const Response &response) |
compares current evaluation to best evaluation and updates best | |
void | update_best (const Real *sample_c_vars, int eval_id, const Response &response) |
compares current evaluation to best evaluation and updates best | |
Private Attributes | |
Real | vbdDropTol |
tolerance for omitting output of small VBD indices | |
RealVectorArray | S4 |
VBD main effect indices. | |
RealVectorArray | T4 |
VBD total effect indices. |
Base class for NonD, DACE, and ParamStudy branches of the iterator hierarchy.
The Analyzer class provides common data and functionality for various types of systems analysis, including nondeterministic analysis, design of experiments, and parameter studies.
void print_results | ( | std::ostream & | s | ) | [protected, virtual] |
print the final iterator results
This virtual function provides additional iterator-specific final results outputs beyond the function evaluation summary printed in finalize_run().
Reimplemented from Iterator.
Reimplemented in PStudyDACE, Verification, NonDExpansion, NonDGlobalReliability, NonDGPMSABayesCalibration, NonDIncremLHSSampling, NonDInterval, NonDLHSSampling, NonDLocalReliability, and RichExtrapVerification.
References Analyzer::bestVarsRespMap, ParamResponsePair::eval_id(), Response::function_values(), Analyzer::numLSqTerms, Analyzer::numObjFns, ParamResponsePair::prp_parameters(), ParamResponsePair::prp_response(), and Dakota::write_data_partial().
void evaluate_parameter_sets | ( | Model & | model, |
bool | log_resp_flag, | ||
bool | log_best_flag | ||
) | [protected] |
perform function evaluations to map parameter sets (allVariables) into response sets (allResponses)
Convenience function for derived classes with sets of function evaluations to perform (e.g., NonDSampling, DDACEDesignCompExp, FSUDesignCompExp, ParamStudy).
References Iterator::activeSet, Analyzer::allHeaders, Analyzer::allResponses, Analyzer::allSamples, Analyzer::allVariables, Model::asynch_compute_response(), Iterator::asynchFlag, Analyzer::compactMode, Model::compute_response(), Response::copy(), Dakota::copy_data(), Model::current_response(), Model::current_variables(), Model::evaluation_id(), Model::synchronize(), Analyzer::update_best(), Analyzer::update_model_from_sample(), and Analyzer::update_model_from_variables().
Referenced by NonDSparseGrid::evaluate_set(), PSUADEDesignCompExp::extract_trends(), ParamStudy::extract_trends(), FSUDesignCompExp::extract_trends(), DDACEDesignCompExp::extract_trends(), NonDLHSSampling::quantify_uncertainty(), NonDIntegration::quantify_uncertainty(), NonDIncremLHSSampling::quantify_uncertainty(), NonDAdaptImpSampling::quantify_uncertainty(), and Analyzer::variance_based_decomp().
void variance_based_decomp | ( | int | ncont, |
int | ndiscint, | ||
int | ndiscreal, | ||
int | num_samples | ||
) | [protected] |
Calculation of sensitivity indices obtained by variance based decomposition. These indices are obtained by the Saltelli version of the Sobol VBD which uses (K+2)*N function evaluations, where K is the number of dimensions (uncertain vars) and N is the number of samples.
References Analyzer::allResponses, Analyzer::allSamples, Analyzer::allVariables, Analyzer::compactMode, Variables::continuous_variables(), Dakota::copy_data(), Variables::discrete_int_variables(), Variables::discrete_real_variables(), Analyzer::evaluate_parameter_sets(), Analyzer::get_parameter_sets(), Iterator::iteratedModel, Iterator::num_samples(), Iterator::numFunctions, Analyzer::S4, Analyzer::T4, and Analyzer::vary_pattern().
Referenced by FSUDesignCompExp::extract_trends(), DDACEDesignCompExp::extract_trends(), and NonDLHSSampling::quantify_uncertainty().
void read_variables_responses | ( | int | num_evals, |
size_t | num_vars | ||
) | [protected] |
convenience function for reading variables/responses (used in derived classes post_input)
read num_evals variables/responses from file
References Dakota::abort_handler(), Analyzer::allResponses, Analyzer::allSamples, Analyzer::allVariables, ParallelLibrary::command_line_post_run_input(), ParallelLibrary::command_line_user_modes(), Analyzer::compactMode, Response::copy(), Variables::copy(), Model::current_response(), Model::current_variables(), Iterator::iteratedModel, Iterator::outputLevel, Model::parallel_library(), and Analyzer::update_best().
Referenced by PSUADEDesignCompExp::post_input(), ParamStudy::post_input(), NonDLHSSampling::post_input(), FSUDesignCompExp::post_input(), and DDACEDesignCompExp::post_input().
void print_sobol_indices | ( | std::ostream & | s | ) | const [protected] |
Printing of VBD results.
printing of variance based decomposition indices.
References Model::continuous_variable_labels(), Model::discrete_int_variable_labels(), Model::discrete_real_variable_labels(), Iterator::iteratedModel, Iterator::numContinuousVars, Iterator::numDiscreteIntVars, Iterator::numDiscreteRealVars, Iterator::numFunctions, Model::response_labels(), Analyzer::S4, Analyzer::T4, Analyzer::vbdDropTol, and Dakota::write_precision.
Referenced by NonDLHSSampling::print_results(), and PStudyDACE::print_results().