$extrastylesheet
Dakota  Version 6.2
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
DiscrepancyCorrection Class Reference

Base class for discrepancy corrections. More...

List of all members.

Public Member Functions

 DiscrepancyCorrection ()
 default constructor
 DiscrepancyCorrection (Model &surr_model, const IntSet &surr_fn_indices, short corr_type, short corr_order)
 standard constructor
 DiscrepancyCorrection (const IntSet &surr_fn_indices, size_t num_fns, size_t num_vars, short corr_type, short corr_order)
 alternate constructor
 ~DiscrepancyCorrection ()
 destructor
void initialize (Model &surr_model, const IntSet &surr_fn_indices, short corr_type, short corr_order)
 initialize the DiscrepancyCorrection data
void initialize (const IntSet &surr_fn_indices, size_t num_fns, size_t num_vars, short corr_type, short corr_order)
 initialize the DiscrepancyCorrection data
void compute (const Variables &vars, const Response &truth_response, const Response &approx_response, bool quiet_flag=false)
 compute the correction required to bring approx_response into agreement with truth_response and store in {add,mult}Corrections
void compute (const Response &truth_response, const Response &approx_response, Response &discrepancy_response, bool quiet_flag=false)
 compute the correction required to bring approx_response into agreement with truth_response and store in discrepancy_response
void apply (const Variables &vars, Response &approx_response, bool quiet_flag=false)
 apply the correction computed in compute() to approx_response
bool active () const
 indicates an active correction via non-empty correctionType
short correction_type () const
 return correctionType
short correction_order () const
 return correctionOrder
short data_order () const
 return dataOrder
bool computed () const
 return correctionComputed

Protected Attributes

IntSet surrogateFnIndices
 for mixed response sets, this array specifies the response function subset that is approximated
short correctionType
 approximation correction approach to be used: NO_CORRECTION, ADDITIVE_CORRECTION, MULTIPLICATIVE_CORRECTION, or COMBINED_CORRECTION.
short correctionOrder
 approximation correction order to be used: 0, 1, or 2
short dataOrder
 order of correction data in 3-bit format: overlay of 1 (value), 2 (gradient), and 4 (Hessian)
bool correctionComputed
 flag indicating whether or not a correction has been computed and is available for application
size_t numFns
 total number of response functions (of which surrogateFnIndices may define a subset)
size_t numVars
 number of continuous variables active in the correction

Private Member Functions

void initialize_corrections ()
 internal convenience function shared by overloaded initialize() variants
bool check_scaling (const RealVector &truth_fns, const RealVector &approx_fns)
 define badScalingFlag
void compute_additive (const Response &truth_response, const Response &approx_response, int index, Real &discrep_fn, RealVector &discrep_grad, RealSymMatrix &discrep_hess)
 internal convenience function for computing additive corrections between truth and approximate responses
void compute_multiplicative (const Response &truth_response, const Response &approx_response, int index, Real &discrep_fn, RealVector &discrep_grad, RealSymMatrix &discrep_hess)
 internal convenience function for computing multiplicative corrections between truth and approximate responses
void apply_additive (const Variables &vars, Response &approx_response)
 internal convenience function for applying additive corrections to an approximate response
void apply_multiplicative (const Variables &vars, Response &approx_response)
 internal convenience function for applying multiplicative corrections to an approximate response
void apply_additive (const Variables &vars, RealVector &approx_fns)
 internal convenience function for applying additive corrections to a set of response functions
void apply_multiplicative (const Variables &vars, RealVector &approx_fns)
 internal convenience function for applying multiplicative corrections to a set of response functions
const Responsesearch_db (const Variables &search_vars, const ShortArray &search_asv)
 search data_pairs for missing approximation data

Private Attributes

bool badScalingFlag
 flag used to indicate function values near zero for multiplicative corrections; triggers an automatic switch to additive corrections
bool computeAdditive
 flag indicating the need for additive correction calculations
bool computeMultiplicative
 flag indicating the need for multiplicative correction calculations
SharedApproxData sharedData
 data that is shared among all correction Approximations
std::vector< ApproximationaddCorrections
 array of additive corrections; surrogate models of a model discrepancy function (formed from model differences)
std::vector< ApproximationmultCorrections
 array of multiplicative corrections; surrogate models of a model discrepancy function (formed from model ratios)
Model surrModel
 shallow copy of the surrogate model instance as returned by Model::surrogate_model() (the DataFitSurrModel or HierarchSurrModel::lowFidelityModel instance)
RealVector combineFactors
 factors for combining additive and multiplicative corrections. Each factor is the weighting applied to the additive correction and 1.-factor is the weighting applied to the multiplicative correction. The factor value is determined by an additional requirement to match the high fidelity function value at the previous correction point (e.g., previous trust region center). This results in a multipoint correction instead of a strictly local correction.
Variables correctionPrevCenterPt
 copy of center point from the previous correction cycle
RealVector truthFnsCenter
 truth function values at the current correction point
RealVector approxFnsCenter
 Surrogate function values at the current correction point.
RealMatrix approxGradsCenter
 Surrogate gradient values at the current correction point.
RealVector truthFnsPrevCenter
 copy of truth function values at center of previous correction cycle
RealVector approxFnsPrevCenter
 copy of approximate function values at center of previous correction cycle

Detailed Description

Base class for discrepancy corrections.

The DiscrepancyCorrection class provides common functions for computing and applying corrections to approximations.


Member Function Documentation

void compute ( const Variables vars,
const Response truth_response,
const Response approx_response,
bool  quiet_flag = false 
)

compute the correction required to bring approx_response into agreement with truth_response and store in {add,mult}Corrections

Compute an additive or multiplicative correction that corrects the approx_response to have 0th-order consistency (matches values), 1st-order consistency (matches values and gradients), or 2nd-order consistency (matches values, gradients, and Hessians) with the truth_response at a single point (e.g., the center of a trust region). The 0th-order, 1st-order, and 2nd-order corrections use scalar values, linear scaling functions, and quadratic scaling functions, respectively, for each response function.

References Response::active_set(), DiscrepancyCorrection::addCorrections, DiscrepancyCorrection::apply(), DiscrepancyCorrection::apply_additive(), DiscrepancyCorrection::apply_multiplicative(), DiscrepancyCorrection::approxFnsCenter, DiscrepancyCorrection::approxFnsPrevCenter, DiscrepancyCorrection::approxGradsCenter, DiscrepancyCorrection::badScalingFlag, DiscrepancyCorrection::check_scaling(), DiscrepancyCorrection::combineFactors, DiscrepancyCorrection::compute_additive(), DiscrepancyCorrection::compute_multiplicative(), DiscrepancyCorrection::computeAdditive, DiscrepancyCorrection::computeMultiplicative, Variables::continuous_variables(), Response::copy(), DiscrepancyCorrection::correctionComputed, DiscrepancyCorrection::correctionOrder, DiscrepancyCorrection::correctionPrevCenterPt, DiscrepancyCorrection::correctionType, DiscrepancyCorrection::dataOrder, Variables::discrete_int_variables(), Variables::discrete_real_variables(), Response::function_gradients(), Response::function_values(), Model::is_null(), DiscrepancyCorrection::multCorrections, DiscrepancyCorrection::numFns, DiscrepancyCorrection::numVars, ActiveSet::request_values(), DiscrepancyCorrection::sharedData, DiscrepancyCorrection::surrModel, DiscrepancyCorrection::surrogateFnIndices, DiscrepancyCorrection::truthFnsCenter, and DiscrepancyCorrection::truthFnsPrevCenter.

Referenced by HierarchSurrModel::derived_asynch_compute_response(), HierarchSurrModel::derived_compute_response(), DataFitSurrModel::derived_compute_response(), HierarchSurrModel::derived_synchronize(), DataFitSurrModel::derived_synchronize(), HierarchSurrModel::derived_synchronize_nowait(), DataFitSurrModel::derived_synchronize_nowait(), and SurrBasedLocalMinimizer::minimize_surrogates().


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