Dakota
Version
Explore and Predict with Confidence
|
Derived approximation class for global basis polynomials. More...
Public Member Functions | |
PecosApproximation () | |
default constructor | |
PecosApproximation (ProblemDescDB &problem_db, const SharedApproxData &shared_data, const String &approx_label) | |
standard ProblemDescDB-driven constructor | |
PecosApproximation (const SharedApproxData &shared_data) | |
alternate constructor | |
~PecosApproximation () | |
destructor | |
void | expansion_coefficient_flag (bool coeff_flag) |
set pecosBasisApprox.configOptions.expansionCoeffFlag | |
bool | expansion_coefficient_flag () const |
get pecosBasisApprox.configOptions.expansionCoeffFlag | |
void | expansion_gradient_flag (bool grad_flag) |
set pecosBasisApprox.configOptions.expansionGradFlag | |
bool | expansion_gradient_flag () const |
get pecosBasisApprox.configOptions.expansionGradFlag | |
void | clear_component_effects () |
clear unused Sobol' indices | |
void | compute_component_effects () |
Performs global sensitivity analysis using Sobol' indices by computing component (main and interaction) effects. | |
void | compute_total_effects () |
Performs global sensitivity analysis using Sobol' indices by computing total effects. | |
const Pecos::RealVector & | sobol_indices () const |
return polyApproxRep->sobolIndices | |
const Pecos::RealVector & | total_sobol_indices () const |
return polyApproxRep->totalSobolIndices | |
size_t | sparsity () const |
return the number of non-zero coefficients for this QoI | |
Pecos::ULongULongMap | sparse_sobol_index_map () const |
return RegressOrthogPolyApproximation::sparseSobolIndexMap | |
const Pecos::RealVector & | dimension_decay_rates () const |
return OrthogPolyApproximation::decayRates | |
void | allocate_arrays () |
invoke Pecos::PolynomialApproximation::allocate_arrays() | |
void | initialize_covariance (Approximation &approx_2) |
initialize covariance accumulators with pointers to other QoI | |
void | clear_covariance_pointers () |
clear covariance pointers to other QoI | |
void | initialize_products () |
initialize covariance accumulators (also reinitialize after change in stats type) | |
bool | product_interpolants () |
query whether product interpolants are defined (non-empty) | |
Real | mean () |
return the mean of the expansion, where all active variables are random | |
Real | mean (const Pecos::RealVector &x) |
return the mean of the expansion for a given parameter vector, where a subset of the active variables are random | |
Real | combined_mean () |
return the mean of the combined expansion, treating all variables as random | |
Real | combined_mean (const Pecos::RealVector &x) |
return the mean of the combined expansion for a given parameter vector, where a subset of the active variables are treated as random | |
const Pecos::RealVector & | mean_gradient () |
return the gradient of the expansion mean for a given parameter vector, where all active variables are random | |
const Pecos::RealVector & | mean_gradient (const Pecos::RealVector &x, const Pecos::SizetArray &dvv) |
return the gradient of the expansion mean for a given parameter vector and given DVV, where a subset of the active variables are random | |
Real | variance () |
return the variance of the expansion, where all active vars are random | |
Real | variance (const Pecos::RealVector &x) |
return the variance of the expansion for a given parameter vector, where a subset of the active variables are random | |
const Pecos::RealVector & | variance_gradient () |
return the gradient of the expansion variance for a given parameter vector, where all active variables are random | |
const Pecos::RealVector & | variance_gradient (const Pecos::RealVector &x, const Pecos::SizetArray &dvv) |
return the gradient of the expansion variance for a given parameter vector and given DVV, where a subset of the active variables are random | |
Real | covariance (Approximation &approx_2) |
return the covariance between two response expansions, treating all variables as random | |
Real | covariance (const Pecos::RealVector &x, Approximation &approx_2) |
return the covariance between two response expansions, treating a subset of the variables as random | |
Real | combined_covariance (Approximation &approx_2) |
return the covariance between two combined response expansions, where all active variables are random | |
Real | combined_covariance (const Pecos::RealVector &x, Approximation &approx_2) |
return the covariance between two combined response expansions, where a subset of the active variables are random | |
Real | beta (bool cdf_flag, Real z_bar) |
return the reliability index (mapped from z_bar), where all active variables are random | |
Real | beta (const RealVector &x, bool cdf_flag, Real z_bar) |
return the reliability index (mapped from z_bar), treating a subset of variables as random | |
Real | combined_beta (bool cdf_flag, Real z_bar) |
return the reliability index (mapped from z_bar), where all active variables are random | |
Real | combined_beta (const RealVector &x, bool cdf_flag, Real z_bar) |
return the reliability index (mapped from z_bar), treating a subset of variables as random | |
Real | delta_mean () |
return the change in mean resulting from expansion refinement, where all active variables are random | |
Real | delta_mean (const RealVector &x) |
return the change in mean resulting from expansion refinement, treating a subset of variables as random | |
Real | delta_combined_mean () |
return the change in mean resulting from combined expansion refinement, where all active variables are random | |
Real | delta_combined_mean (const RealVector &x) |
return the change in mean resulting from combined expansion refinement, treating a subset of variables as random | |
Real | delta_std_deviation () |
return the change in standard deviation resulting from expansion refinement, where all active variables are random | |
Real | delta_std_deviation (const RealVector &x) |
return the change in standard deviation resulting from expansion refinement, treating a subset of variables as random | |
Real | delta_combined_std_deviation () |
return the change in standard deviation resulting from combined expansion refinement, where all active variables are random | |
Real | delta_combined_std_deviation (const RealVector &x) |
return the change in standard deviation resulting from combined expansion refinement, treating a subset of variables as random | |
Real | delta_variance () |
return the change in variance resulting from expansion refinement, where all active variables are random | |
Real | delta_variance (const RealVector &x) |
return the change in variance resulting from expansion refinement, treating a subset of variables as random | |
Real | delta_combined_variance () |
return the change in variance resulting from combined expansion refinement, where all active variables are random | |
Real | delta_combined_variance (const RealVector &x) |
return the change in variance resulting from combined expansion refinement, treating a subset of variables as random | |
Real | delta_covariance (Approximation &approx_2) |
return the change in covariance resulting from expansion refinement, where all active variables are random | |
Real | delta_covariance (const Pecos::RealVector &x, Approximation &approx_2) |
return the change in covariance resulting from expansion refinement, where a subset of the active variables are random | |
Real | delta_combined_covariance (Approximation &approx_2) |
return the change in covariance resulting from expansion refinement, where all active variables are random | |
Real | delta_combined_covariance (const Pecos::RealVector &x, Approximation &approx_2) |
return the change in covariance resulting from expansion refinement, where a subset of the active variables are random | |
Real | delta_beta (bool cdf_flag, Real z_bar) |
return the change in reliability index (mapped from z_bar) resulting from expansion refinement, where all active variables are random | |
Real | delta_beta (const RealVector &x, bool cdf_flag, Real z_bar) |
return the change in reliability index (mapped from z_bar) resulting from expansion refinement, treating a subset of variables as random | |
Real | delta_combined_beta (bool cdf_flag, Real z_bar) |
return the change in reliability index (mapped from z_bar) resulting from expansion refinement, where all active variables are random | |
Real | delta_combined_beta (const RealVector &x, bool cdf_flag, Real z_bar) |
return the change in reliability index (mapped from z_bar) resulting from expansion refinement, treating a subset of variables as random | |
Real | delta_z (bool cdf_flag, Real beta_bar) |
return the change in response level (mapped from beta_bar) resulting from expansion refinement, where all active variables are random | |
Real | delta_z (const RealVector &x, bool cdf_flag, Real beta_bar) |
return the change in response level (mapped from beta_bar) resulting from expansion refinement, where a subset of the active variables are random | |
Real | delta_combined_z (bool cdf_flag, Real beta_bar) |
return the change in response level (mapped from beta_bar) resulting from expansion refinement, where all active variables are random | |
Real | delta_combined_z (const RealVector &x, bool cdf_flag, Real beta_bar) |
return the change in response level (mapped from beta_bar) resulting from expansion refinement, where a subset of the active variables are random | |
void | compute_moments (bool full_stats=true, bool combined_stats=false) |
compute moments up to the order supported by the Pecos polynomial approximation | |
void | compute_moments (const Pecos::RealVector &x, bool full_stats=true, bool combined_stats=false) |
compute moments in all-variables mode up to the order supported by the Pecos polynomial approximation | |
const RealVector & | moments () const |
return primary moments using Pecos::PolynomialApproximation::moments() | |
const RealVector & | expansion_moments () const |
return expansion moments from Pecos::PolynomialApproximation | |
const RealVector & | numerical_integration_moments () const |
return numerical moments from Pecos::PolynomialApproximation | |
const RealVector & | combined_moments () const |
return combined moments from multilevel-muktifidelity expansion roll-up | |
Real | moment (size_t i) const |
return primary moment using Pecos::PolynomialApproximation::moment(i) | |
void | moment (Real mom, size_t i) |
set primary moment using Pecos::PolynomialApproximation::moment(i) | |
Real | combined_moment (size_t i) const |
return Pecos::PolynomialApproximation::combinedMoments[i] | |
void | combined_moment (Real mom, size_t i) |
set Pecos::PolynomialApproximation::combinedMoments[i] | |
void | clear_computed_bits () |
clear tracking of computed moments, due to a change that invalidates previous results | |
void | build_linear_system (RealMatrix &A, const UShort2DArray &multi_index) |
construct the Vandermonde matrix "A" for PCE regression for Ax = b | |
void | augment_linear_system (const RealVectorArray &samples, RealMatrix &A, const UShort2DArray &multi_index) |
Pecos::BasisApproximation & | pecos_basis_approximation () |
return pecosBasisApprox | |
Public Member Functions inherited from Approximation | |
Approximation () | |
default constructor More... | |
Approximation (ProblemDescDB &problem_db, const SharedApproxData &shared_data, const String &approx_label) | |
standard constructor for envelope More... | |
Approximation (const SharedApproxData &shared_data) | |
alternate constructor More... | |
Approximation (const Approximation &approx) | |
copy constructor More... | |
virtual | ~Approximation () |
destructor | |
Approximation | operator= (const Approximation &approx) |
assignment operator | |
virtual void | clear_model_keys () |
reset initial state by removing all model keys for an approximation | |
virtual void | export_model (const StringArray &var_labels=StringArray(), const String &fn_label="", const String &export_prefix="", const unsigned short export_format=NO_MODEL_FORMAT) |
exports the approximation; if export_format > NO_MODEL_FORMAT, uses all 3 parameters, otherwise extracts these from the Approximation's sharedDataRep to build a filename | |
virtual void | export_model (const Variables &vars, const String &fn_label="", const String &export_prefix="", const unsigned short export_format=NO_MODEL_FORMAT) |
approximation export that generates labels from the passed Variables, since only the derived classes know how the variables are ordered w.r.t. the surrogate build; if export_format > NO_MODEL_FORMAT, uses all 3 parameters, otherwise extracts these from the Approximation's sharedDataRep to build a filename | |
virtual void | replace (const IntResponsePair &response_pr, size_t fn_index) |
replace the response data | |
virtual void | clear_current_active_data () |
clear current build data in preparation for next build More... | |
virtual Real | prediction_variance (const Variables &vars) |
retrieve the variance of the predicted value for a given parameter vector | |
virtual Real | value (const RealVector &c_vars) |
retrieve the approximate function value for a given parameter vector | |
virtual const RealVector & | gradient (const RealVector &c_vars) |
retrieve the approximate function gradient for a given parameter vector | |
virtual const RealSymMatrix & | hessian (const RealVector &c_vars) |
retrieve the approximate function Hessian for a given parameter vector | |
virtual Real | prediction_variance (const RealVector &c_vars) |
retrieve the variance of the predicted value for a given parameter vector | |
virtual Real | mean (const RealVector &x) |
return the mean of the expansion for a given parameter vector, where a subset of the active variables are random | |
virtual Real | combined_mean (const RealVector &x) |
return the mean of the combined expansion for a given parameter vector, where a subset of the active variables are random | |
virtual const RealVector & | mean_gradient (const RealVector &x, const SizetArray &dvv) |
return the gradient of the expansion mean | |
virtual Real | variance (const RealVector &x) |
return the variance of the expansion for a given parameter vector, where a subset of the active variables are random | |
virtual const RealVector & | variance_gradient (const RealVector &x, const SizetArray &dvv) |
virtual Real | covariance (const RealVector &x, Approximation &approx_2) |
return the covariance between two response expansions, treating a subset of the variables as random | |
virtual Real | combined_covariance (const RealVector &x, Approximation &approx_2) |
return the covariance between two combined response expansions, where a subset of the active variables are random | |
virtual void | compute_moments (const RealVector &x, bool full_stats=true, bool combined_stats=false) |
virtual bool | diagnostics_available () |
check if diagnostics are available for this approximation type | |
virtual Real | diagnostic (const String &metric_type) |
retrieve a single diagnostic metric for the diagnostic type specified | |
virtual RealArray | cv_diagnostic (const StringArray &metric_types, unsigned num_folds) |
retrieve diagnostic metrics for the diagnostic types specified, applying | |
virtual void | primary_diagnostics (size_t fn_index) |
compute and print all requested diagnostics and cross-validation | |
virtual RealArray | challenge_diagnostic (const StringArray &metric_types, const RealMatrix &challenge_points, const RealVector &challenge_responses) |
compute requested diagnostics for user provided challenge pts | |
virtual void | challenge_diagnostics (size_t fn_index, const RealMatrix &challenge_points, const RealVector &challenge_responses) |
compute and print all requested diagnostics for user provided challenge pts | |
virtual int | recommended_coefficients () const |
return the recommended number of samples (unknowns) required to build the derived class approximation type in numVars dimensions | |
virtual int | num_constraints () const |
return the number of constraints to be enforced via an anchor point | |
virtual void | map_variable_labels (const Variables &dfsm_vars) |
if needed, map passed all variable labels to approximation's labels | |
int | min_points (bool constraint_flag) const |
return the minimum number of points required to build the approximation type in numVars dimensions. Uses *_coefficients() and num_constraints(). | |
int | recommended_points (bool constraint_flag) const |
return the recommended number of samples to build the approximation type in numVars dimensions (default same as min_points) | |
void | pop_data (bool save_data) |
removes entries from end of SurrogateData::{vars,resp}Data (last points appended, or as specified in args) | |
void | push_data () |
restores SurrogateData state prior to previous pop() | |
void | finalize_data () |
finalize SurrogateData by applying all remaining trial sets | |
const Pecos::SurrogateData & | surrogate_data () const |
return approxData | |
Pecos::SurrogateData & | surrogate_data () |
return approxData | |
void | add (const Variables &vars, bool v_copy, const Response &response, size_t fn_index, bool r_copy, bool anchor_flag, int eval_id, size_t key_index=_NPOS) |
create SurrogateData{Vars,Resp} and append to SurrogateData:: {varsData,respData,dataIdentifiers} | |
void | add (const Real *c_vars, bool v_copy, const Response &response, size_t fn_index, bool r_copy, bool anchor_flag, int eval_id, size_t key_index=_NPOS) |
create SurrogateData{Vars,Resp} and append to SurrogateData:: {varsData,respData,dataIdentifiers} | |
void | add (const Pecos::SurrogateDataVars &sdv, bool v_copy, const Response &response, size_t fn_index, bool r_copy, bool anchor_flag, int eval_id, size_t key_index=_NPOS) |
create a SurrogateDataResp and append to SurrogateData:: {varsData,respData,dataIdentifiers} | |
void | add (const Pecos::SurrogateDataVars &sdv, bool v_copy, const Pecos::SurrogateDataResp &sdr, bool r_copy, bool anchor_flag, int eval_id, size_t key_index=_NPOS) |
append to SurrogateData::{varsData,respData,dataIdentifiers} | |
void | add_array (const RealMatrix &sample_vars, bool v_copy, const RealVector &sample_resp, bool r_copy, size_t key_index=_NPOS) |
add surrogate data from the provided sample and response data, assuming continuous variables and function values only More... | |
void | pop_count (size_t count, size_t key_index) |
appends to SurrogateData::popCountStack (number of entries to pop from end of SurrogateData::{vars,resp}Data, based on size of last data append) | |
void | clear_data () |
clear SurrogateData::{vars,resp}Data for activeKey + embedded keys More... | |
void | clear_active_data () |
clear active approximation data | |
void | clear_inactive_data () |
clear inactive approximation data | |
void | clear_active_popped () |
clear SurrogateData::popped{Vars,Resp}Trials,popCountStack for activeKey | |
void | clear_popped () |
clear SurrogateData::popped{Vars,Resp}Trials,popCountStack for all keys | |
void | set_bounds (const RealVector &c_l_bnds, const RealVector &c_u_bnds, const IntVector &di_l_bnds, const IntVector &di_u_bnds, const RealVector &dr_l_bnds, const RealVector &dr_u_bnds) |
set approximation lower and upper bounds (currently only used by graphics) | |
std::shared_ptr< Approximation > | approx_rep () const |
returns approxRep for access to derived class member functions that are not mapped to the top Approximation level | |
Protected Member Functions | |
void | active_model_key (const Pecos::ActiveKey &key) |
assign active key in approxData and update_active_iterators() | |
Real | value (const Variables &vars) |
retrieve the approximate function value for a given parameter vector | |
const Pecos::RealVector & | gradient (const Variables &vars) |
retrieve the approximate function gradient for a given parameter vector | |
const Pecos::RealSymMatrix & | hessian (const Variables &vars) |
retrieve the approximate function Hessian for a given parameter vector | |
int | min_coefficients () const |
return the minimum number of samples (unknowns) required to build the derived class approximation type in numVars dimensions | |
void | build () |
builds the approximation from scratch More... | |
void | rebuild () |
rebuilds the approximation incrementally | |
void | pop_coefficients (bool save_data) |
removes entries from end of SurrogateData::{vars,resp}Data (last points appended, or as specified in args) | |
void | push_coefficients () |
restores state prior to previous pop() | |
void | finalize_coefficients () |
finalize approximation by applying all remaining trial sets | |
void | combine_coefficients () |
combine all level approximations into a single aggregate approximation | |
void | combined_to_active_coefficients (bool clear_combined=true) |
promote combined approximation into active approximation | |
void | clear_inactive_coefficients () |
prune inactive coefficients following combination and promotion to active | |
bool | advancement_available () |
check if resolution advancement (e.g., order, rank) is available for this approximation instance | |
void | print_coefficients (std::ostream &s, bool normalized) |
print the coefficient array computed in build()/rebuild() | |
RealVector | approximation_coefficients (bool normalized) const |
return expansion coefficients in a form consistent with the shared multi-index | |
void | approximation_coefficients (const RealVector &approx_coeffs, bool normalized) |
set expansion coefficients in a form consistent with the shared multi-index | |
void | coefficient_labels (std::vector< std::string > &coeff_labels) const |
print the coefficient array computed in build()/rebuild() | |
Protected Member Functions inherited from Approximation | |
Approximation (BaseConstructor, const ProblemDescDB &problem_db, const SharedApproxData &shared_data, const String &approx_label) | |
constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More... | |
Approximation (NoDBBaseConstructor, const SharedApproxData &shared_data) | |
constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More... | |
Pecos::SurrogateDataVars | variables_to_sdv (const Real *sample_c_vars) |
create a SurrogateDataVars instance from a Real* | |
Pecos::SurrogateDataVars | variables_to_sdv (const Variables &vars) |
create a SurrogateDataVars instance by extracting data from a Variables object | |
Pecos::SurrogateDataResp | response_to_sdr (const Response &response, size_t fn_index) |
create a SurrogateDataResp instance by extracting data for a particular QoI from a Response object | |
void | add (const Pecos::SurrogateDataVars &sdv, bool v_copy, const Pecos::SurrogateDataResp &sdr, bool r_copy, bool anchor_flag) |
tracks a new data point by appending to SurrogateData::{vars,Resp}Data | |
void | add (int eval_id) |
tracks a new data point by appending to SurrogateData::dataIdentifiers | |
void | check_points (size_t num_build_pts) |
Check number of build points against minimum required. | |
void | assign_key_index (size_t key_index) |
extract and assign i-th embedded active key | |
Private Member Functions | |
void | approx_type_to_basis_type (const String &approx_type, short &basis_type) |
utility to convert Dakota type string to Pecos type enumeration | |
Private Attributes | |
Pecos::BasisApproximation | pecosBasisApprox |
the Pecos basis approximation, encompassing orthogonal and interpolation polynomial approximations | |
std::shared_ptr< Pecos::PolynomialApproximation > | polyApproxRep |
convenience pointer to representation of Pecos polynomial approximation | |
Additional Inherited Members | |
Protected Attributes inherited from Approximation | |
Pecos::SurrogateData | approxData |
contains the variables/response data for constructing a single approximation model (one response function). There is only one SurrogateData instance per Approximation, although it may contain keys for different model forms/resolutions and aggregations (e.g., discrepancies) among forms/resolutions. | |
RealVector | approxGradient |
gradient of the approximation returned by gradient() | |
RealSymMatrix | approxHessian |
Hessian of the approximation returned by hessian() | |
String | approxLabel |
label for approximation, if applicable | |
std::shared_ptr< SharedApproxData > | sharedDataRep |
contains the approximation data that is shared among the response set | |
Derived approximation class for global basis polynomials.
The PecosApproximation class provides a global approximation based on basis polynomials. This includes orthogonal polynomials used for polynomial chaos expansions and interpolation polynomials used for stochastic collocation.
|
inlineprotectedvirtual |
builds the approximation from scratch
This is the common base class portion of the virtual fn and is insufficient on its own; derived implementations should explicitly invoke (or reimplement) this base class contribution.
Reimplemented from Approximation.
References Approximation::build(), and PecosApproximation::pecosBasisApprox.