Dakota  Version 6.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SensAnalysisGlobal Class Reference

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, StringMultiArrayConstView cv_labels, StringMultiArrayConstView div_labels, StringMultiArrayConstView dsv_labels, StringMultiArrayConstView drv_labels, const StringArray &resp_labels) const
 save correlations to database
 
bool correlations_computed () const
 returns corrComputed to indicate whether compute_correlations() has been invoked
 
void print_correlations (std::ostream &s, StringMultiArrayConstView cv_labels, StringMultiArrayConstView div_labels, StringMultiArrayConstView dsv_labels, StringMultiArrayConstView drv_labels, const StringArray &resp_labels) const
 prints the correlations 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 center_rows (RealMatrix &data_matrix)
 center the passed matrix by its mean, in-place
 
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...
 

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
 
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
 

Detailed Description

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.

Member Function Documentation

void compute_correlations ( const VariablesArray &  vars_samples,
const IntResponseMap &  resp_samples,
const StringSetArray &  dss_vals 
)
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().

void values_to_ranks ( RealMatrix &  valid_data)
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().

void simple_corr ( RealMatrix &  total_data,
const int &  num_in,
RealMatrix &  corr_matrix 
)
private

computes simple correlations, populating corr_matrix

Calculates simple correlation coefficients from a matrix of data (oriented factors x observations):

  • num_corr is number of rows of total data
  • num_in indicates whether only pairs of correlations should be calculated between pairs of columns (num_in vs. num_corr-num_in); if num_in = num_corr, correlations are calculated between all columns

References SensAnalysisGlobal::center_rows(), and SensAnalysisGlobal::correl_adjust().

Referenced by SensAnalysisGlobal::compute_correlations().

void partial_corr ( RealMatrix &  total_data,
const int  num_in,
const RealMatrix &  simple_corr_mat,
RealMatrix &  corr_matrix,
bool &  numerical_issues 
)
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(), SensAnalysisGlobal::center_rows(), SensAnalysisGlobal::correl_adjust(), Dakota::qr(), Dakota::qr_rsolve(), and Dakota::svd().

Referenced by SensAnalysisGlobal::compute_correlations().


The documentation for this class was generated from the following files: