$extrastylesheet
Dakota
Version 6.2
|
Base class for the nonlinear least squares branch of the iterator hierarchy. More...
Protected Member Functions | |
LeastSq () | |
default constructor | |
LeastSq (ProblemDescDB &problem_db, Model &model) | |
standard constructor | |
LeastSq (unsigned short method_name, Model &model) | |
alternate "on the fly" constructor | |
~LeastSq () | |
destructor | |
void | initialize_run () |
void | core_run () |
core portion of run; implemented by all derived classes and may include pre/post steps in lieu of separate pre/post | |
void | post_run (std::ostream &s) |
void | finalize_run () |
utility function to perform common operations following post_run(); deallocation and resetting of instance pointers | |
void | print_results (std::ostream &s) |
virtual void | minimize_residuals ()=0 |
Used within the least squares branch for minimizing the sum of squares residuals. Redefines the run virtual function for the least squares branch. | |
void | get_confidence_intervals () |
Calculate confidence intervals on estimated parameters. | |
Protected Attributes | |
size_t | numLeastSqTerms |
number of least squares terms | |
LeastSq * | prevLSqInstance |
pointer containing previous value of leastSqInstance | |
bool | weightFlag |
flag indicating whether weighted least squares is active | |
RealVector | confBoundsLower |
lower bounds for confidence intervals on calibration parameters | |
RealVector | confBoundsUpper |
upper bounds for confidence intervals on calibration parameters | |
Static Protected Attributes | |
static LeastSq * | leastSqInstance |
pointer to LeastSq instance used in static member functions | |
Private Member Functions | |
void | weight_model () |
Wrap iteratedModel in a RecastModel that weights the residuals. | |
Static Private Member Functions | |
static void | primary_resp_weighter (const Variables &unweighted_vars, const Variables &weighted_vars, const Response &unweighted_response, Response &weighted_response) |
Recast callback function to weight least squares residuals, gradients, and Hessians. |
Base class for the nonlinear least squares branch of the iterator hierarchy.
The LeastSq class provides common data and functionality for least squares solvers (including NL2OL, NLSSOLLeastSq, and SNLLLeastSq.
LeastSq | ( | ProblemDescDB & | problem_db, |
Model & | model | ||
) | [protected] |
standard constructor
This constructor extracts the inherited data for the least squares branch and performs sanity checking on gradient and constraint settings.
References Dakota::abort_handler(), Iterator::bestVariablesArray, Minimizer::calibrationDataFlag, Variables::copy(), Model::current_variables(), Minimizer::data_transform_model(), Iterator::iteratedModel, Iterator::methodName, LeastSq::numLeastSqTerms, Minimizer::numTotalCalibTerms, Minimizer::optimizationFlag, Model::primary_fn_type(), Minimizer::scale_model(), Minimizer::scaleFlag, LeastSq::weight_model(), and LeastSq::weightFlag.
void initialize_run | ( | ) | [protected, virtual] |
This function should be invoked (or reimplemented) by any derived implementations of initialize_run() (which would otherwise hide it).
Reimplemented from Minimizer.
Reimplemented in SNLLLeastSq.
References Minimizer::calibrationDataFlag, Iterator::iteratedModel, LeastSq::leastSqInstance, LeastSq::prevLSqInstance, Minimizer::scaleFlag, and Model::update_from_subordinate_model().
void core_run | ( | ) | [inline, protected, virtual] |
core portion of run; implemented by all derived classes and may include pre/post steps in lieu of separate pre/post
Virtual run function for the iterator class hierarchy. All derived classes need to redefine it.
Reimplemented from Iterator.
References LeastSq::minimize_residuals().
void post_run | ( | std::ostream & | s | ) | [protected, virtual] |
Implements portions of post_run specific to LeastSq for scaling back to native variables and functions. This function should be invoked (or reimplemented) by any derived implementations of post_run() (which would otherwise hide it).
transform variables back to inbound model, before any potential lookup
Reimplemented from Minimizer.
Reimplemented in SNLLLeastSq.
References Dakota::abort_handler(), Response::active_set_request_vector(), Iterator::bestResponseArray, Iterator::bestVariablesArray, Minimizer::calibrationDataFlag, Variables::continuous_variables(), Response::copy(), Minimizer::cvScaleMultipliers, Minimizer::cvScaleOffsets, Minimizer::cvScaleTypes, Minimizer::expData, Response::function_value(), Response::function_values(), Response::function_values_view(), LeastSq::get_confidence_intervals(), ExperimentData::interpolate_flag(), Iterator::iteratedModel, Minimizer::local_recast_retrieve(), Minimizer::modify_s2n(), Minimizer::need_resp_trans_byvars(), LeastSq::numLeastSqTerms, Minimizer::numNonlinearConstraints, Minimizer::numUserPrimaryFns, Model::primary_response_fn_weights(), Minimizer::primaryRespScaleFlag, ExperimentData::recover_model(), Minimizer::response_modify_s2n(), Minimizer::secondaryRespScaleFlag, Model::subordinate_model(), Response::update_partial(), Minimizer::varsScaleFlag, and LeastSq::weightFlag.
void finalize_run | ( | ) | [inline, protected, virtual] |
utility function to perform common operations following post_run(); deallocation and resetting of instance pointers
Optional: perform finalization phases of run sequence, like deallocating memory and resetting instance pointers. Commonly used in sub-iterator executions. This is a virtual function; when re-implementing, a derived class must call its nearest parent's finalize_run(), typically _after_ performing its own implementation steps.
Reimplemented from Minimizer.
Reimplemented in SNLLLeastSq.
References LeastSq::leastSqInstance, and LeastSq::prevLSqInstance.
void print_results | ( | std::ostream & | s | ) | [protected, virtual] |
Redefines default iterator results printing to include nonlinear least squares results (residual terms and constraints).
Reimplemented from Iterator.
References Iterator::activeSet, Minimizer::archive_allocate_best(), Minimizer::archive_best(), Iterator::bestResponseArray, Iterator::bestVariablesArray, Minimizer::calibrationDataFlag, LeastSq::confBoundsLower, LeastSq::confBoundsUpper, Model::continuous_variable_labels(), Response::copy(), Model::current_response(), Minimizer::data_difference_core(), Dakota::data_pairs, Model::interface_id(), Iterator::iteratedModel, Dakota::lookup_by_val(), Model::num_functions(), Minimizer::numContinuousVars, Minimizer::numNonlinearConstraints, Minimizer::numTotalCalibTerms, Minimizer::numUserPrimaryFns, Minimizer::original_model(), Model::primary_response_fn_weights(), Minimizer::print_model_resp(), Minimizer::print_residuals(), ActiveSet::request_values(), Model::subordinate_model(), and Dakota::write_precision.
void get_confidence_intervals | ( | ) | [protected] |
Calculate confidence intervals on estimated parameters.
Calculate individual confidence intervals for each parameter. These bounds are based on a linear approximation of the nonlinear model.
References Iterator::activeSet, Iterator::bestResponseArray, Iterator::bestVariablesArray, Minimizer::calibrationDataFlag, Model::compute_response(), LeastSq::confBoundsLower, LeastSq::confBoundsUpper, Model::continuous_variables(), Response::copy(), Model::current_response(), Minimizer::data_difference_core(), Response::function_gradients(), Iterator::iteratedModel, Minimizer::numContinuousVars, LeastSq::numLeastSqTerms, Minimizer::original_model(), ActiveSet::request_values(), Minimizer::scaleFlag, and Minimizer::vendorNumericalGradFlag.
Referenced by LeastSq::post_run(), and SNLLLeastSq::post_run().
void weight_model | ( | ) | [private] |
Wrap iteratedModel in a RecastModel that weights the residuals.
Setup Recast for weighting model the weighting transformation doesn't resize, so use numUserPrimaryFns. No vars, active set or secondary mapping. All indices are one-to-one mapped (no change in counts).
References Model::assign_rep(), Iterator::iteratedModel, Minimizer::minimizerRecasts, Minimizer::numContinuousVars, LeastSq::numLeastSqTerms, Minimizer::numNonlinearConstraints, Minimizer::numNonlinearIneqConstraints, Iterator::outputLevel, LeastSq::primary_resp_weighter(), Model::primary_response_fn_sense(), Model::primary_response_fn_weights(), Minimizer::secondary_resp_copier(), and Model::subordinate_model().
Referenced by LeastSq::LeastSq().
void primary_resp_weighter | ( | const Variables & | unweighted_vars, |
const Variables & | weighted_vars, | ||
const Response & | unweighted_response, | ||
Response & | weighted_response | ||
) | [static, private] |
Recast callback function to weight least squares residuals, gradients, and Hessians.
Apply weights to least squares residuals
References Dakota::_NPOS, Response::active_set_derivative_vector(), Response::active_set_request_vector(), Variables::acv(), Variables::all_continuous_variable_ids(), Variables::continuous_variable_ids(), Variables::cv(), Dakota::find_index(), Response::function_gradients(), Response::function_gradients_view(), Response::function_hessian(), Response::function_hessian_view(), Response::function_values(), Response::function_values_view(), Variables::icv(), Variables::inactive_continuous_variable_ids(), Iterator::iteratedModel, LeastSq::leastSqInstance, LeastSq::numLeastSqTerms, Iterator::outputLevel, Model::primary_response_fn_weights(), and Model::subordinate_model().
Referenced by LeastSq::weight_model().