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

Derived approximation class for global basis polynomials. More...

Inheritance diagram for PecosApproximation:
Approximation

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 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
 
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()
 
Real mean ()
 return the mean of the expansion, treating all variables as random
 
Real mean (const Pecos::RealVector &x)
 return the mean of the expansion for a given parameter vector, treating a subset of the variables as random
 
const Pecos::RealVector & mean_gradient ()
 return the gradient of the expansion mean for a given parameter vector, treating all variables as 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, treating a subset of the variables as random
 
Real variance ()
 return the variance of the expansion, treating all variables as random
 
Real variance (const Pecos::RealVector &x)
 return the variance of the expansion for a given parameter vector, treating a subset of the variables as random
 
const Pecos::RealVector & variance_gradient ()
 return the gradient of the expansion variance for a given parameter vector, treating all variables as 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, treating a subset of the variables as random
 
Real covariance (PecosApproximation *pecos_approx_2)
 return the covariance between two response expansions, treating all variables as random
 
Real covariance (const Pecos::RealVector &x, PecosApproximation *pecos_approx_2)
 return the covariance between two response expansions, treating a subset of the variables as random
 
Real delta_covariance (PecosApproximation *pecos_approx_2)
 return the change in covariance between two response expansions, treating all variables as random
 
Real delta_covariance (const Pecos::RealVector &x, PecosApproximation *pecos_approx_2)
 return the change in covariance between two response expansions, treating a subset of the variables as random
 
Real delta_mean ()
 return the change in mean between two response expansions, treating all variables as random
 
Real delta_mean (const RealVector &x)
 return the change in mean between two response expansions, treating a subset of variables as random
 
Real delta_std_deviation ()
 return the change in standard deviation between two response expansions, treating all variables as random
 
Real delta_std_deviation (const RealVector &x)
 return the change in standard deviation between two response expansions, treating a subset of variables as random
 
Real delta_beta (bool cdf_flag, Real z_bar)
 return the change in reliability index (mapped from z_bar) between two response expansions, treating all variables as random
 
Real delta_beta (const RealVector &x, bool cdf_flag, Real z_bar)
 return the change in reliability index (mapped from z_bar) between two response expansions, 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) between two response expansions, treating all variables as random
 
Real delta_z (const RealVector &x, bool cdf_flag, Real beta_bar)
 return the change in response level (mapped from beta_bar) between two response expansions, treating a subset of the variables as random
 
void compute_moments ()
 compute moments up to the order supported by the Pecos polynomial approximation
 
void compute_moments (const Pecos::RealVector &x)
 compute moments in all-variables mode up to the order supported by the Pecos polynomial approximation
 
const RealVector & moments () const
 return virtual Pecos::PolynomialApproximation::moments()
 
const RealVector & expansion_moments () const
 return Pecos::PolynomialApproximation::expansionMoments
 
const RealVector & numerical_integration_moments () const
 return Pecos::PolynomialApproximation::numericalMoments
 
void standardize_moments (const Pecos::RealVector &central_moments, Pecos::RealVector &std_moments)
 standardize the central moments returned from Pecos
 
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)
 
const Pecos::SurrogateData & surrogate_data () const
 
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 More...
 
Approximation operator= (const Approximation &approx)
 assignment operator More...
 
virtual void export_model (const String &fn_label="", const String &export_prefix="", const unsigned short export_format=NO_MODEL_FORMAT)
 exports the approximation 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 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 (int 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 (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 clear_current ()
 clear current build data in preparation for next build More...
 
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)
 
const Pecos::SurrogateData & approximation_data () const
 return approxData
 
void add (const Pecos::SurrogateDataVars &sdv, bool anchor_flag)
 append to SurrogateData::varsData or assign to SurrogateData::anchorVars
 
void add (const Variables &vars, bool anchor_flag, bool deep_copy)
 extract the relevant vectors from Variables and invoke add(RealVector&, IntVector&, RealVector&)
 
void add (const Real *sample_c_vars, bool anchor_flag, bool deep_copy)
 create a RealVector view and invoke add(RealVector&, empty, empty)
 
void add (const RealVector &c_vars, const IntVector &di_vars, const RealVector &dr_vars, bool anchor_flag, bool deep_copy)
 shared code among add(Variables&) and add(Real*); adds a new data point by either appending to SurrogateData::varsData or assigning to SurrogateData::anchorVars, as dictated by anchor_flag. Uses add_point() and add_anchor().
 
void add (const Pecos::SurrogateDataResp &sdr, bool anchor_flag)
 append to SurrogateData::respData or assign to SurrogateData::anchorResp
 
void add (const Response &response, int fn_index, bool anchor_flag, bool deep_copy)
 adds a new data point by either appending to SurrogateData::respData or assigning to SurrogateData::anchorResp, as dictated by anchor_flag. Uses add_point() and add_anchor().
 
void add (const RealMatrix &sample_vars, const RealVector &sample_resp)
 add data from the provided samples and response matrices, assuming continuous variables and function values only
 
void pop_count (size_t count)
 appends to popCountStack (number of entries to pop from end of SurrogateData::{vars,resp}Data, based on size of last data set appended)
 
void clear_all ()
 clear all build data (current and history) to restore original state More...
 
void clear_anchor ()
 clear SurrogateData::anchor{Vars,Resp}
 
void clear_data ()
 clear SurrogateData::{vars,resp}Data
 
void clear_popped ()
 clear popCountStack and SurrogateData::popped{Vars,Resp}Trials
 
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)
 
Approximationapprox_rep () const
 returns approxRep for access to derived class member functions that are not mapped to the top Approximation level
 

Protected Member Functions

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 More...
 
void pop (bool save_data)
 removes entries from end of SurrogateData::{vars,resp}Data (last points appended, or as specified in args) More...
 
void push ()
 restores state prior to previous pop() More...
 
void finalize ()
 finalize approximation by applying all remaining trial sets More...
 
void store (size_t index=_NPOS)
 store current approximation state for later combination
 
void restore (size_t index=_NPOS)
 restore previous approximation state
 
void remove_stored (size_t index=_NPOS)
 remove a stored approximation prior to combination
 
void combine (short corr_type, size_t swap_index)
 combine current approximation with previously stored approximation
 
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...
 

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 OrthogPolyApproximation and InterpPolyApproximation
 
Pecos::PolynomialApproximation * polyApproxRep
 convenience pointer to representation of Pecos polynomial approximation
 

Additional Inherited Members

- Protected Attributes inherited from Approximation
RealVector approxGradient
 gradient of the approximation returned by gradient()
 
RealSymMatrix approxHessian
 Hessian of the approximation returned by hessian()
 
Pecos::SurrogateData approxData
 contains the variables/response data for constructing a single approximation model (one response function)
 
SharedApproxDatasharedDataRep
 contains the approximation data that is shared among the response set
 
String approxLabel
 label for approximation, if applicable
 

Detailed Description

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.

Member Function Documentation

void build ( )
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.

void rebuild ( )
inlineprotectedvirtual

rebuilds the approximation incrementally

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 PecosApproximation::pecosBasisApprox.

void pop ( bool  save_data)
inlineprotectedvirtual

removes entries from end of SurrogateData::{vars,resp}Data (last points appended, or as specified in args)

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 PecosApproximation::pecosBasisApprox, and Approximation::pop().

void push ( )
inlineprotectedvirtual

restores state prior to previous pop()

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 PecosApproximation::pecosBasisApprox, and Approximation::push().

void finalize ( )
inlineprotectedvirtual

finalize approximation by applying all remaining trial sets

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::finalize(), and PecosApproximation::pecosBasisApprox.


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