Dakota  Version
Explore and Predict with Confidence
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
SharedC3ApproxData Class Reference

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

Inheritance diagram for SharedC3ApproxData:
SharedApproxData

Public Member Functions

 SharedC3ApproxData ()
 default constructor
 
 SharedC3ApproxData (ProblemDescDB &problem_db, size_t num_vars)
 standard ProblemDescDB-driven constructor
 
 SharedC3ApproxData (const String &approx_type, const UShortArray &approx_order, size_t num_vars, short data_order, short output_level)
 on-the-fly constructor (no problem DB)
 
 ~SharedC3ApproxData ()
 destructor
 
size_t regression_size ()
 return number of FT unknowns using start_rank(), max_rank(), start_orders(), max_order()
 
size_t max_rank_regression_size ()
 return number of FT unknowns using maximum rank, start_orders(), max_order()
 
size_t max_order_regression_size ()
 return number of FT unknowns using start_rank(), max_rank(), and maximum basis order
 
size_t max_regression_size ()
 return number of FT unknowns using maxima for rank and basis order
 
void set_parameter (String var, const UShortArray &val)
 set UShortArray attribute value based on identifier string
 
void set_parameter (String var, unsigned short val)
 set unsigned short attribute value based on identifier string
 
void set_parameter (String var, size_t val)
 set size_t attribute value based on identifier string
 
void set_parameter (String var, bool val)
 set bool attribute value based on identifier string
 
void set_parameter (String var, short val)
 set short attribute value based on identifier string
 
void set_parameter (String var, double val)
 set double attribute value based on identifier string
 
void set_parameter (String var, int val)
 set int attribute value based on identifier string
 
void set_active_parameter (String var, const UShortArray &val)
 set active UShortArray attribute value based on identifier string
 
void set_active_parameter (String var, unsigned short val)
 set active unsigned short attribute value based on identifier string
 
void set_active_parameter (String var, size_t val)
 set active size_t attribute value based on identifier string
 
void set_active_parameter (String var, int val)
 set active int attribute value based on identifier string
 
const UShortArray & start_orders () const
 return active start value for basis order
 
UShortArray & start_orders ()
 return active start value for basis order (mutable)
 
unsigned short max_order () const
 return active maximum value for basis order
 
unsigned short & max_order ()
 return active maximum value for basis order (mutable)
 
size_t start_rank () const
 return active start value for expansion rank
 
size_t & start_rank ()
 return active start value for expansion rank (mutable)
 
size_t max_rank () const
 return active maximum value for expansion rank
 
size_t & max_rank ()
 return active maximum value for expansion rank (mutable)
 
size_t max_cross_validation_rank_candidates () const
 return maxCVRankCandidates
 
unsigned short max_cross_validation_order_candidates () const
 return maxCVOrderCandidates
 
void assign_start_ranks (SizetVector &start_ranks) const
 
void update_basis ()
 update oneApproxOpts with active basis orders after an order change
 
void update_basis (const UShortArray &start_orders, unsigned short max_order)
 update oneApproxOpts with passed basis orders after an order change
 
void update_basis (size_t v, unsigned short start_order, unsigned short max_order)
 update oneApproxOpts for variable v with passed basis orders
 
- Public Member Functions inherited from SharedApproxData
 SharedApproxData ()
 default constructor More...
 
 SharedApproxData (ProblemDescDB &problem_db, size_t num_vars)
 standard constructor for envelope More...
 
 SharedApproxData (const String &approx_type, const UShortArray &approx_order, size_t num_vars, short data_order, short output_level)
 alternate constructor for envelope More...
 
 SharedApproxData (const SharedApproxData &approx)
 copy constructor More...
 
virtual ~SharedApproxData ()
 destructor
 
SharedApproxData operator= (const SharedApproxData &approx)
 assignment operator
 
virtual void clear_model_keys ()
 reset initial state by clearing all model keys for an approximation
 
virtual void integration_iterator (const Iterator &iterator)
 set integration driver for structured grid approximations
 
virtual void rebuild ()
 rebuilds the shared approximation data incrementally
 
virtual void pre_push ()
 push a previous state of the shared approximation data
 
virtual size_t finalize_index (size_t i, const Pecos::ActiveKey &key)
 return index of i-th trial set within restorable bookkeeping sets
 
virtual void pre_finalize ()
 finalize the shared approximation data following a set of increments
 
virtual void post_finalize ()
 clean up popped bookkeeping following aggregation
 
virtual void clear_inactive ()
 clear inactive approximation data
 
virtual void post_combine ()
 clean up stored data sets after aggregation
 
virtual void combined_to_active (bool clear_combined=true)
 promote aggregated data sets to active state
 
virtual void update_basis_distribution_parameters (const Pecos::MultivariateDistribution &mvd)
 propagate updates to random variable distribution parameters to a polynomial basis
 
virtual void configuration_options (const Pecos::ExpansionConfigOptions &ec_options)
 set ExpansionConfigOptions instance as a group specification
 
virtual void configuration_options (const Pecos::BasisConfigOptions &bc_options)
 set BasisConfigOptions instance as a group specification
 
virtual void configuration_options (const Pecos::RegressionConfigOptions &rc_options)
 set BasisConfigOptions instance as a group specification
 
virtual void refinement_statistics_mode (short stats_mode)
 assign mode for statistics roll-up: {ACTIVE,COMBINED}_EXPANSION_STATS
 
virtual const Pecos::BitArrayULongMap & sobol_index_map () const
 return set of Sobol indices that have been requested (e.g., as constrained by throttling) and are computable by a (sparse) expansion of limited order
 
const Pecos::ActiveKey & active_model_key () const
 return active multi-index key
 
void discrepancy_emulation_mode (short mode)
 set discrepancy emulation mode for approximating response differences
 
short discrepancy_emulation_mode () const
 return discrepancy emulation mode for approximating response differences
 
bool formulation_updated () const
 query whether the form of an approximation has been updated
 
void formulation_updated (bool update)
 assign the status of approximation formulation updates
 
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< SharedApproxDatadata_rep () const
 returns dataRep for access to derived class member functions that are not mapped to the top SharedApproxData level
 

Static Public Member Functions

static size_t regression_size (size_t num_v, size_t rank, size_t max_rank, const UShortArray &orders, unsigned short max_order)
 return number of FT unknowns given scalars: num vars, rank, order More...
 

Protected Member Functions

void active_model_key (const Pecos::ActiveKey &key)
 activate an approximation state based on its multi-index key
 
void construct_basis (const Pecos::MultivariateDistribution &mv_dist)
 construct the shared basis for an expansion-based approximation
 
short discrepancy_reduction () const
 return the discrepancy type for approximations that support MLMF
 
void random_variables_key (const BitArray &random_vars_key)
 assign key identifying a subset of variables that are to be treated as random for statistical purposes (e.g. expectation)
 
void build ()
 builds the shared approximation data from scratch
 
void increment_order ()
 increments polynomial expansion order (PCE, FT)
 
void decrement_order ()
 decrements polynomial expansion order (PCE, FT)
 
void pop (bool save_surr_data)
 back out the previous increment to the shared approximation data
 
bool push_available ()
 queries availability of pushing data associated with a trial set
 
size_t push_index (const Pecos::ActiveKey &key)
 return index for restoring trial set within stored data sets
 
void post_push ()
 clean up popped bookkeeping following push
 
void pre_combine ()
 aggregate the shared approximation data from current and stored states
 
bool advancement_available ()
 queries availability of advancing the approximation resolution
 
void max_rank_advancement (bool r_advance)
 
void max_order_advancement (bool o_advance)
 
bool increment_max_rank ()
 
bool increment_max_order ()
 
- Protected Member Functions inherited from SharedApproxData
 SharedApproxData (BaseConstructor, ProblemDescDB &problem_db, size_t num_vars)
 constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More...
 
 SharedApproxData (NoDBBaseConstructor, const String &approx_type, size_t num_vars, short data_order, short output_level)
 constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More...
 

Protected Attributes

std::vector< OneApproxOpts * > oneApproxOpts
 one-D approximation options (basis type, poly order, etc.)
 
MultiApproxOpts * multiApproxOpts
 n-D approximation options, augmenting one-D options
 
bool respScaling
 option to scale response data prior to regression
 
UShortArray startOrders
 starting user specification for polynomial orders (from start_order scalar plus anisotropic dimension preference)
 
std::map< Pecos::ActiveKey, UShortArray > startOrdersMap
 starting values for polynomial order (prior to adaptive refinement); for each model key, there is an array of polynomial orders per variable
 
unsigned short kickOrder
 user specification for increment in order used within adapt_order
 
unsigned short maxOrder
 maximum value for polynomial order from user spec
 
std::map< Pecos::ActiveKey, unsigned short > maxOrderMap
 user specification for maximum order used within adapt_order; usually a scalar specification but can be adapted per model key for MAX_{ORDER,RANK_ORDER}_ADVANCEMENT refine types
 
bool adaptOrder
 C3 FT can support CV over polynomial order in addition to adapt_rank.
 
UShortArray combinedOrders
 polynomial basis order for combined expansion for each variable core
 
size_t startRank
 starting user specification for rank (not augmented by dimension preference); Note: rank sequence spec is managed externally and becomes reflected in startRank model index mapping
 
std::map< Pecos::ActiveKey, size_t > startRankMap
 starting values for rank (note: adapt_rank currently covers refinement); for each model index key, there is a scalar starting rank (recovered rank in C3FnrainPtrs can vary per core/variable and per QoI)
 
size_t kickRank
 user specification for increment in rank used within adapt_rank
 
size_t maxRank
 scalar user specification for maximum allowable rank when adapting
 
std::map< Pecos::ActiveKey, size_t > maxRankMap
 user specification for maximum rank used within adapt_rank; usually a scalar specification but can be adapted per model key for MAX_{RANK,RANK_ORDER}_ADVANCEMENT refine types
 
bool adaptRank
 internal C3 adaptation that identifies the best rank representation for a set of sample data based on cross validation
 
short regressType
 type of regression solver for forming FT approximation
 
double regressRegParam
 penalty parameter if regularized regression
 
double solverTol
 tolerance on regression solver
 
double solverRoundingTol
 tolerance for rounding (performing a truncation operation on a FT expansion) within the regression solver
 
double statsRoundingTol
 tolerance for rounding (performing a truncation operation on a FT expansion) when post-processing an expansion: computing products for moments, combining expansions with c3axpy, etc.
 
size_t maxSolverIterations
 maximum number of iterations for regression solver
 
int crossMaxIter
 maximum number of iterations for (future) cross iteration solver
 
int randomSeed
 C3 regression solver employs a random seed.
 
short combineType
 type of discrepancy calculation: additive, multiplicative, or both
 
short discrepReduction
 type of multilevel discrepancy emulation: distinct or recursive
 
short allocControl
 type of multilevel strategy for sample allocation: ESTIMATOR_VARIANCE, RANK_SAMPLING, GREEDY
 
short c3AdvancementType
 type of advancement strategy used in uniform refinement: {START_ORDER,START_RANK,MAX_ORDER,MAX_RANK,MAX_RANK_ORDER}_ADVANCEMENT
 
std::map< Pecos::ActiveKey, bool > c3MaxRankAdvance
 flag indicating availability of rank advancement (accumulated from C3Approximation::advancement_available())
 
std::map< Pecos::ActiveKey, bool > c3MaxOrderAdvance
 flag indicating availability of order advancement (accumulated from C3Approximation::advancement_available())
 
unsigned short maxCVOrderCandidates
 restrict the number of candidates within cross validation for order (by increasing start order when needed as max order is advanced)
 
size_t maxCVRankCandidates
 restrict the number of candidates within cross validation for rank (by increasing start rank when needed as max rank is advanced)
 
SizetArray randomIndices
 indices for random subset when approximating in all-variables mode
 
std::map< Pecos::ActiveKey, size_t > poppedCounts
 number of instances within the popped arrays (mostly a placeholder for supporting push_available())
 
- Protected Attributes inherited from SharedApproxData
size_t numVars
 number of variables in the approximation
 
String approxType
 approximation type identifier
 
short buildDataOrder
 order of the data used for surrogate construction, in ActiveSet request vector 3-bit format. More...
 
short outputLevel
 output verbosity level: {SILENT,QUIET,NORMAL,VERBOSE,DEBUG}_OUTPUT
 
Pecos::ActiveKey activeKey
 key indicating the active model or model-pair used for approximation data
 
short discrepEmulationMode
 approach for emulating response differences: {DEFAULT,DISTINCT,RECURSIVE}_EMULATION
 
String modelExportPrefix
 Prefix for model export files.
 
unsigned short modelExportFormat
 Bitmapped format request for exported models.
 
RealVector approxCLowerBnds
 approximation continuous lower bounds (used by 3D graphics and Surfpack KrigingModel)
 
RealVector approxCUpperBnds
 approximation continuous upper bounds (used by 3D graphics and Surfpack KrigingModel)
 
IntVector approxDILowerBnds
 approximation continuous lower bounds
 
IntVector approxDIUpperBnds
 approximation continuous upper bounds
 
RealVector approxDRLowerBnds
 approximation continuous lower bounds
 
RealVector approxDRUpperBnds
 approximation continuous upper bounds
 
std::map< Pecos::ActiveKey, bool > formUpdated
 tracker for changes in order,rank configuration since last build (used by DataFitSurrModel::rebuild_approximation())
 

Friends

class C3Approximation
 

Detailed Description

Derived approximation class for global basis polynomials.

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

◆ regression_size()

size_t regression_size ( size_t  num_v,
size_t  rank,
size_t  max_rank,
const UShortArray &  orders,
unsigned short  max_order 
)
inlinestatic

return number of FT unknowns given scalars: num vars, rank, order

simplified estimation for scalar-valued rank and order (e.g., from start rank/order user specification) inline size_t SharedC3ApproxData:: regression_size(size_t num_v, size_t rank, size_t order) { Each dimension has its own rank within the product of function cores. This fn estimates for the case where rank and order are either constant across dimensions or averaged into a scalar.

the first and last core contribute p*r terms the middle cores contribute r*r*p terms

size_t p = order+1.; switch (num_v) { case 1: return p; break; // collapses to a 1D PCE case 2: return 2.*p*rank; break; // first and last core, no middle default: return p*rank*(2. + (num_v-2)*rank); break; // first,last,middle } } simplified estimation for scalar-valued rank and vector-valued order (e.g., from start rank/start order/dimension pref user specification)

References SharedC3ApproxData::max_order(), and SharedC3ApproxData::max_rank().


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