Dakota
Version
Explore and Predict with Confidence
|
Class for a utility class containing correlation calculations and variance-based decomposition. More...
Public Member Functions | |
SensAnalysisGlobal () | |
constructor | |
~SensAnalysisGlobal () | |
destructor | |
void | compute_correlations (const VariablesArray &vars_samples, const IntResponseMap &resp_samples, const StringSetArray &dss_vals) |
computes four correlation matrices for input and output data simple, partial, simple rank, and partial rank More... | |
void | compute_correlations (const RealMatrix &vars_samples, const IntResponseMap &resp_samples) |
computes four correlation matrices for input and output data simple, partial, simple rank, and partial rank More... | |
void | archive_correlations (const StrStrSizet &run_identifier, ResultsManager &iterator_results, const StringArray &var_labels, const StringArray &resp_labels, const size_t &inc_id=0) const |
save correlations to database | |
void | archive_std_regress_coeffs (const StrStrSizet &run_identifier, ResultsManager &iterator_results, const StringArray &var_labels, const StringArray &resp_labels, const size_t &inc_id=0) const |
save standardized regression coefficients to database | |
bool | correlations_computed () const |
returns corrComputed to indicate whether compute_correlations() has been invoked | |
void | print_correlations (std::ostream &s, const StringArray &var_labels, const StringArray &resp_labels) const |
prints the correlations computed in compute_correlations() | |
void | compute_std_regress_coeffs (const RealMatrix &vars_samples, const IntResponseMap &resp_samples) |
computes standardized regression coefficients and corresponding R^2 values for input and output data | |
void | print_std_regress_coeffs (std::ostream &s, StringArray var_labels, const StringArray &resp_labels) const |
prints the SRCs and R^2 values computed in compute_correlations() | |
Private Member Functions | |
size_t | find_valid_samples (const IntResponseMap &resp_samples, BoolDeque &valid_sample) |
find samples with finite response (any sample with any Nan or +/-Inf observation will be dropped) | |
void | valid_sample_matrix (const VariablesArray &vars_samples, const IntResponseMap &resp_samples, const StringSetArray &dss_vals, const BoolDeque is_valid_sample, RealMatrix &valid_data) |
extract a compact valid sample (vars/resp) matrix from the passed data | |
void | valid_sample_matrix (const RealMatrix &vars_samples, const IntResponseMap &resp_samples, const BoolDeque is_valid_sample, RealMatrix &valid_samples) |
extract a compact valid sample (vars/resp) matrix from the passed data | |
void | values_to_ranks (RealMatrix &valid_data) |
replace sample values with their ranks, in-place More... | |
void | correl_adjust (Real &corr_value) |
if result was NaN/Inf, preserve it, otherwise truncate to [-1.0, 1.0] | |
void | simple_corr (RealMatrix &total_data, const int &num_in, RealMatrix &corr_matrix) |
computes simple correlations, populating corr_matrix More... | |
void | partial_corr (RealMatrix &total_data, const int num_in, const RealMatrix &simple_corr_mat, RealMatrix &corr_matrix, bool &numerical_issues) |
computes partial correlations, populating corr_matrix and numerical_issues More... | |
bool | has_nan_or_inf (const RealMatrix &corr) const |
Return true if there are any NaN or Inf entries in the matrix. | |
void | check_correlations_for_nan_or_inf (std::ostream &s) const |
Check correlation matrices for nans or infs and print warning message. | |
void | print_simple_correlations (std::ostream &s, const StringArray &var_labels, const StringArray &resp_labels, bool rank) const |
print simple (rank = false) or simple rank (rank = true) correlations | |
void | print_partial_correlations (std::ostream &s, const StringArray &var_labels, const StringArray &resp_labels, bool rank) const |
print partial (rank = false) or partial rank (rank = true) correlations | |
void | archive_simple_correlations (const StrStrSizet &run_identifier, ResultsManager &iterator_results, const StringArray &var_labels, const StringArray &resp_labels, const std::vector< const char * > &combined_desc, const size_t &inc_id, bool rank) const |
archive simple (rank = false) or simple rank (rank = true) correlations | |
void | archive_partial_correlations (const StrStrSizet &run_identifier, ResultsManager &iterator_results, const StringArray &var_labels, const StringArray &resp_labels, const size_t &inc_id, bool rank) const |
archive partial (rank = false) or partial rank (rank = true) correlations | |
Static Private Member Functions | |
static bool | rank_sort (const int &x, const int &y) |
sort algorithm to compute ranks for rank correlations | |
Private Attributes | |
RealMatrix | simpleCorr |
matrix to hold simple raw correlations | |
RealMatrix | simpleRankCorr |
matrix to hold simple rank correlations | |
RealMatrix | partialCorr |
matrix to hold partial raw correlations | |
RealMatrix | partialRankCorr |
matrix to hold partial rank correlations | |
RealMatrix | stdRegressCoeffs |
matrix to hold standardized regression coefficients | |
RealVector | stdRegressCODs |
vector to hold coefficients of determination, eg R^2 values | |
size_t | numFns |
number of responses | |
size_t | numVars |
number of inputs | |
bool | numericalIssuesRaw |
flag indicating numerical issues in partial raw correlation calculations | |
bool | numericalIssuesRank |
flag indicating numerical issues in partial rank correlation calculations | |
bool | corrComputed |
flag indictaing whether correlations have been computed | |
Static Private Attributes | |
static RealArray | rawData = RealArray() |
array to hold temporary data before sort | |
Class for a utility class containing correlation calculations and variance-based decomposition.
This class provides code for several of the sampling methods both in the NonD branch and in the PStudyDACE branch. Currently, the utility functions provide global sensitivity analysis through correlation calculations (e.g. simple, partial, rank, raw) as well as variance-based decomposition.
void compute_correlations | ( | const VariablesArray & | vars_samples, |
const IntResponseMap & | resp_samples, | ||
const StringSetArray & | dss_vals | ||
) |
computes four correlation matrices for input and output data simple, partial, simple rank, and partial rank
This version is used when full variables objects are being processed. Calculates simple correlation, partial correlation, simple rank correlation, and partial rank correlation coefficients.
References Dakota::abort_handler(), SensAnalysisGlobal::corrComputed, SensAnalysisGlobal::find_valid_samples(), SensAnalysisGlobal::numericalIssuesRank, SensAnalysisGlobal::numericalIssuesRaw, SensAnalysisGlobal::numFns, SensAnalysisGlobal::numVars, SensAnalysisGlobal::partial_corr(), SensAnalysisGlobal::partialCorr, SensAnalysisGlobal::partialRankCorr, SensAnalysisGlobal::simple_corr(), SensAnalysisGlobal::simpleCorr, SensAnalysisGlobal::simpleRankCorr, SensAnalysisGlobal::valid_sample_matrix(), and SensAnalysisGlobal::values_to_ranks().
Referenced by NonDSampling::compute_statistics(), DDACEDesignCompExp::post_run(), FSUDesignCompExp::post_run(), and ParamStudy::post_run().
void compute_correlations | ( | const RealMatrix & | vars_samples, |
const IntResponseMap & | resp_samples | ||
) |
computes four correlation matrices for input and output data simple, partial, simple rank, and partial rank
This version is used when compact samples matrix is being processed. Calculates simple correlation, partial correlation, simple rank correlation, and partial rank correlation coefficients.
References Dakota::abort_handler(), SensAnalysisGlobal::corrComputed, SensAnalysisGlobal::find_valid_samples(), SensAnalysisGlobal::numericalIssuesRank, SensAnalysisGlobal::numericalIssuesRaw, SensAnalysisGlobal::numFns, SensAnalysisGlobal::numVars, SensAnalysisGlobal::partial_corr(), SensAnalysisGlobal::partialCorr, SensAnalysisGlobal::partialRankCorr, SensAnalysisGlobal::simple_corr(), SensAnalysisGlobal::simpleCorr, SensAnalysisGlobal::simpleRankCorr, SensAnalysisGlobal::valid_sample_matrix(), and SensAnalysisGlobal::values_to_ranks().
|
private |
replace sample values with their ranks, in-place
When converting values to ranks, uses the average ranks of any tied values
Referenced by SensAnalysisGlobal::compute_correlations().
|
private |
computes simple correlations, populating corr_matrix
Calculates simple correlation coefficients from a matrix of data (oriented factors x observations):
References Dakota::center_matrix_rows(), and SensAnalysisGlobal::correl_adjust().
Referenced by SensAnalysisGlobal::compute_correlations().
|
private |
computes partial correlations, populating corr_matrix and numerical_issues
Calculates partial correlation coefficients between num_in inputs and numRows() - num_in outputs.
References Dakota::abort_handler(), Dakota::center_matrix_rows(), SensAnalysisGlobal::correl_adjust(), Dakota::qr(), Dakota::qr_rsolve(), and Dakota::svd().
Referenced by SensAnalysisGlobal::compute_correlations().