queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
GPMSAOptions.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 //
3 // QUESO - a library to support the Quantification of Uncertainty
4 // for Estimation, Simulation and Optimization
5 //
6 // Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the Version 2.1 GNU Lesser General
10 // Public License as published by the Free Software Foundation.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
20 // Boston, MA 02110-1301 USA
21 //
22 //-----------------------------------------------------------------------el-
23 
24 #include <queso/Environment.h>
25 #include <queso/SharedPtr.h>
26 
27 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
28 #include <queso/BoostInputOptionsParser.h>
29 #include <queso/ScopedPtr.h>
30 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
31 
32 #ifndef UQ_GPMSA_OPTIONS_H
33 #define UQ_GPMSA_OPTIONS_H
34 
35 namespace QUESO {
36 
46 {
47 public:
49  GPMSAOptions(const BaseEnvironment& env, const char* prefix);
50 
52  GPMSAOptions();
53 
55  void set_prefix(const char* prefix);
56 
58  void set_defaults();
59 
61  void parse(const BaseEnvironment& env, const char* prefix);
62 
64  virtual ~GPMSAOptions();
65 
67  void print(std::ostream& os) const;
68 
70  std::string m_prefix;
71 
73  std::string m_help;
74 
76  // emulator output. If this number is set to be zero (as it is by
77  // default), then the number of basis vectors will be determined at
78  // run time to preserve some minimum fraction of the variance in
79  // simulation output.
81 
83  // capture with the emulator basis. By default this is 1.0, i.e.
84  // 100%, in which case there will be one basis vector for each
85  // dimension in the simulation output space.
86  //
87  // Currently the only supported value is 1.0
89 
91  // the supplied data, for uncertain parameter i.
92  //
93  // Normalized values will range from 0 to 1.
94  void set_autoscale_minmax_uncertain_parameter(unsigned int i);
95 
97  // the supplied data, for scenario parameter i.
98  //
99  // Normalized values will range from 0 to 1.
100  void set_autoscale_minmax_scenario_parameter(unsigned int i);
101 
103  // the supplied data, for all input uncertain parameters, all input
104  // scenario parameters, and all output values.
105  //
106  // Normalized values will range from 0 to 1.
107  void set_autoscale_minmax();
108 
110  // supplied data, for uncertain parameter i.
111  //
112  // Normalized values will have mean 0 and standard deviation 1.
113  void set_autoscale_meanvar_uncertain_parameter(unsigned int i);
114 
116  // supplied data, for scenario parameter i.
117  //
118  // Normalized values will have mean 0 and standard deviation 1.
119  void set_autoscale_meanvar_scenario_parameter(unsigned int i);
120 
122  // supplied data, for all input uncertain parameters, all input
123  // scenario parameters, and all output values.
124  //
125  // Normalized values will have mean 0 and standard deviation 1.
126  void set_autoscale_meanvar();
127 
129  // the physical parameter range (range_min, range_max) which should
130  // be rescaled to (0,1)
131  //
132  // If no value is set and no automatic normalization is specified,
133  // a default of (0,1) will be used; i.e. no normalization.
134  //
135  // This option is mutually exclusive with the above automatic
136  // scaling options; trying to use both is a runtime error.
137  void set_uncertain_parameter_scaling(unsigned int i,
138  double range_min,
139  double range_max);
140 
142  // experimental inputs, of the physical parameter range (range_min,
143  // range_max) which should be rescaled to (0,1)
144  //
145  // If no value is set and no automatic normalization is specified,
146  // a default of (0,1) will be used; i.e. no normalization.
147  //
148  // This option is mutually exclusive with the above automatic
149  // scaling options; trying to use both is a runtime error.
150  void set_scenario_parameter_scaling(unsigned int i,
151  double range_min,
152  double range_max);
153 
155  // experimental outputs, of the physical output range (range_min,
156  // range_max) which should be rescaled to (0,1)
157  //
158  // If no value is set and no automatic normalization is specified,
159  // a default of (0,1) will be used; i.e. no normalization.
160  //
161  // This option is mutually exclusive with the above automatic
162  // scaling options; trying to use both is a runtime error.
163  void set_output_scaling(unsigned int i,
164  double range_min,
165  double range_max);
166 
168  // which should be rescaled to (0,1), based on our autoscaling option
169  // settings.
170  template <typename V>
171  void set_final_scaling
172  (const std::vector<typename SharedPtr<V>::Type> & m_simulationScenarios,
173  const std::vector<typename SharedPtr<V>::Type> & m_simulationParameters,
174  const std::vector<typename SharedPtr<V>::Type> & m_simulationOutputs,
175  const std::vector<typename SharedPtr<V>::Type> & m_experimentScenarios,
176  const std::vector<typename SharedPtr<V>::Type> & m_experimentOutputs);
177 
179  // specified scenario parameter.
180  double normalized_scenario_parameter(unsigned int i,
181  double physical_param) const;
182 
184  // specified uncertain parameter.
185  double normalized_uncertain_parameter(unsigned int i,
186  double physical_param) const;
187 
190 
193 
195  // lambda_y rather than a fixed multiplier of 1.
196  //
197  // False by default.
199 
202 
205 
206 
209 
212 
215 
218 
221 
224 
226  const BaseEnvironment& env() const;
227 
230 
233 
234  friend std::ostream & operator<<(std::ostream& os, const GPMSAOptions & obj);
235 
236 private:
238 
239 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
241 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
242 
243  // True if the specified autoscaling should be done for all inputs
246 
247  // True if the specified autoscaling should be done for the specific
248  // uncertain input parameter index
249  std::set<unsigned int> m_autoscaleMinMaxUncertain;
250  std::set<unsigned int> m_autoscaleMeanVarUncertain;
251 
252  // True if the specified autoscaling should be done for the specific
253  // scenario input parameter index
254  std::set<unsigned int> m_autoscaleMinMaxScenario;
255  std::set<unsigned int> m_autoscaleMeanVarScenario;
256 
257  // The point in each uncertain input parameter range (typically min
258  // or mean) corresponding to a normalized parameter of 0
259  std::vector<double> m_uncertainScaleMin;
260 
261  // The width of the physical uncertain input parameter range
262  // (typically max minus min or standard deviation) corresponding to
263  // a normalized width of 1
264  std::vector<double> m_uncertainScaleRange;
265 
266  // The point in each input scenario parameter range (typically min
267  // or mean) corresponding to a normalized parameter of 0
268  std::vector<double> m_scenarioScaleMin;
269 
270  // The width of the physical input scenario parameter range
271  // (typically max minus min or standard deviation) corresponding to
272  // a normalized width of 1
273  std::vector<double> m_scenarioScaleRange;
274 
275  std::string m_option_help;
291 
294 
295  void checkOptions();
296 };
297 
298 } // End namespace QUESO
299 
300 #endif // UQ_GPMSA_OPTIONS_H
std::shared_ptr< T > Type
Definition: SharedPtr.h:69
std::string m_option_observationalPrecisionShape
Definition: GPMSAOptions.h:281
std::string m_option_discrepancyPrecisionShape
Definition: GPMSAOptions.h:285
std::unique_ptr< T > Type
Definition: ScopedPtr.h:76
void print(std::ostream &os) const
Prints this to os.
Definition: GPMSAOptions.C:590
void set_autoscale_meanvar_scenario_parameter(unsigned int i)
Do automatic normalization, using mean and variance of the.
Definition: GPMSAOptions.C:376
std::string m_option_emulatorDataPrecisionShape
Definition: GPMSAOptions.h:289
double m_emulatorDataPrecisionScale
The scale parameter for the Gamma hyperprior for the emulator data precision.
Definition: GPMSAOptions.h:232
double m_emulatorCorrelationStrengthBeta
The beta paramter for the Beta hyperprior for the emulator correlation strength.
Definition: GPMSAOptions.h:211
double normalized_uncertain_parameter(unsigned int i, double physical_param) const
Calculate a normalized value from a physical value for the.
Definition: GPMSAOptions.C:568
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:198
std::vector< double > m_uncertainScaleMin
Definition: GPMSAOptions.h:259
double m_emulatorPrecisionScale
The scale parameter for the Gamma hyperprior for the emulator precision.
Definition: GPMSAOptions.h:192
std::string m_option_emulatorBasisVarianceToCapture
Definition: GPMSAOptions.h:277
std::vector< double > m_scenarioScaleMin
Definition: GPMSAOptions.h:268
std::string m_option_discrepancyPrecisionScale
Definition: GPMSAOptions.h:286
void set_autoscale_meanvar_uncertain_parameter(unsigned int i)
Do automatic normalization, using mean and variance of the.
Definition: GPMSAOptions.C:369
std::string m_option_observationalPrecisionScale
Definition: GPMSAOptions.h:282
std::string m_option_autoscaleMeanVarAll
Definition: GPMSAOptions.h:293
void set_output_scaling(unsigned int i, double range_min, double range_max)
Set a value, for output value i in simulation and.
std::string m_option_discrepancyCorrelationStrengthBeta
Definition: GPMSAOptions.h:288
void set_uncertain_parameter_scaling(unsigned int i, double range_min, double range_max)
Set a value, for uncertain parameter i in simulation inputs, of.
Definition: GPMSAOptions.C:383
void set_prefix(const char *prefix)
Set parameter option names to begin with prefix.
Definition: GPMSAOptions.C:118
virtual ~GPMSAOptions()
Destructor.
Definition: GPMSAOptions.C:335
int m_maxEmulatorBasisVectors
The maximum number of basis vectors to use for approximating.
Definition: GPMSAOptions.h:80
double m_discrepancyCorrelationStrengthBeta
The beta paramter for the Beta hyperprior for the discrepancy correlation strength.
Definition: GPMSAOptions.h:223
std::string m_option_discrepancyCorrelationStrengthAlpha
Definition: GPMSAOptions.h:287
std::string m_option_emulatorDataPrecisionScale
Definition: GPMSAOptions.h:290
std::string m_prefix
The prefix to look for in the input file.
Definition: GPMSAOptions.h:70
std::string m_option_calibrateObservationalPrecision
Definition: GPMSAOptions.h:280
QUESO::ScopedPtr< BoostInputOptionsParser >::Type m_parser
Definition: GPMSAOptions.h:240
const BaseEnvironment * m_env
Definition: GPMSAOptions.h:237
std::string m_help
If this string is non-empty, print the options object to the output file.
Definition: GPMSAOptions.h:73
double m_emulatorCorrelationStrengthAlpha
The alpha paramter for the Beta hyperprior for the emulator correlation strength. ...
Definition: GPMSAOptions.h:208
void set_scenario_parameter_scaling(unsigned int i, double range_min, double range_max)
Set a value, for scenario parameter i in simulation and.
Definition: GPMSAOptions.C:398
std::string m_option_emulatorPrecisionShape
Definition: GPMSAOptions.h:278
std::vector< double > m_scenarioScaleRange
Definition: GPMSAOptions.h:273
double m_discrepancyPrecisionScale
The scale parameter for the Gamma hyperprior for the discrepancy precision.
Definition: GPMSAOptions.h:217
double m_emulatorPrecisionShape
The shape parameter for the Gamma hyperprior for the emulator precision.
Definition: GPMSAOptions.h:189
void parse(const BaseEnvironment &env, const char *prefix)
Given prefix, read the input file for parameters named &quot;prefix&quot;+*.
Definition: GPMSAOptions.C:172
double normalized_scenario_parameter(unsigned int i, double physical_param) const
Calculate a normalized value from a physical value for the.
Definition: GPMSAOptions.C:556
std::string m_option_emulatorCorrelationStrengthAlpha
Definition: GPMSAOptions.h:283
double m_discrepancyPrecisionShape
The shape parameter for the Gamma hyperprior for the discrepancy precision.
Definition: GPMSAOptions.h:214
std::string m_option_help
Definition: GPMSAOptions.h:275
double m_emulatorDataPrecisionShape
The shape parameter for the Gamma hyperprior for the emulator data precision.
Definition: GPMSAOptions.h:229
bool m_calibrateObservationalPrecision
Whether to use an observational error precision hyperparameter.
Definition: GPMSAOptions.h:198
GPMSAOptions()
Construct with default parameters.
Definition: GPMSAOptions.C:105
void set_autoscale_minmax_uncertain_parameter(unsigned int i)
Do automatic normalization, using minimum and maximum values in.
Definition: GPMSAOptions.C:348
std::set< unsigned int > m_autoscaleMinMaxScenario
Definition: GPMSAOptions.h:254
std::set< unsigned int > m_autoscaleMinMaxUncertain
Definition: GPMSAOptions.h:249
void set_final_scaling(const std::vector< typename SharedPtr< V >::Type > &m_simulationScenarios, const std::vector< typename SharedPtr< V >::Type > &m_simulationParameters, const std::vector< typename SharedPtr< V >::Type > &m_simulationOutputs, const std::vector< typename SharedPtr< V >::Type > &m_experimentScenarios, const std::vector< typename SharedPtr< V >::Type > &m_experimentOutputs)
Determine the physical parameter ranges (range_min, range_max)
Definition: GPMSAOptions.C:415
std::set< unsigned int > m_autoscaleMeanVarUncertain
Definition: GPMSAOptions.h:250
double m_discrepancyCorrelationStrengthAlpha
The alpha paramter for the Beta hyperprior for the discrepancy correlation strength.
Definition: GPMSAOptions.h:220
friend std::ostream & operator<<(std::ostream &os, const GPMSAOptions &obj)
Definition: GPMSAOptions.C:611
const BaseEnvironment & env() const
Returns the QUESO environment.
double m_emulatorBasisVarianceToCapture
The minimum fraction of the variance in simulation output to.
Definition: GPMSAOptions.h:88
std::string m_option_maxEmulatorBasisVectors
Definition: GPMSAOptions.h:276
void set_defaults()
Set default values for parameter options.
Definition: GPMSAOptions.C:145
double m_observationalPrecisionScale
The scale parameter for the Gamma hyperprior for the observational precision.
Definition: GPMSAOptions.h:204
void set_autoscale_minmax_scenario_parameter(unsigned int i)
Do automatic normalization, using minimum and maximum values in.
Definition: GPMSAOptions.C:355
std::string m_option_emulatorPrecisionScale
Definition: GPMSAOptions.h:279
std::string m_option_autoscaleMinMaxAll
Definition: GPMSAOptions.h:292
void set_autoscale_minmax()
Do automatic normalization, using minimum and maximum values in.
Definition: GPMSAOptions.C:341
double m_observationalPrecisionShape
The shape parameter for the Gamma hyperprior for the observational precision.
Definition: GPMSAOptions.h:201
This class defines the options that specify the behaviour of the Gaussian process emulator...
Definition: GPMSAOptions.h:45
std::string m_option_emulatorCorrelationStrengthBeta
Definition: GPMSAOptions.h:284
void set_autoscale_meanvar()
Do automatic normalization, using mean and variance of the.
Definition: GPMSAOptions.C:362
std::set< unsigned int > m_autoscaleMeanVarScenario
Definition: GPMSAOptions.h:255
std::vector< double > m_uncertainScaleRange
Definition: GPMSAOptions.h:264

Generated on Tue Jun 5 2018 19:48:55 for queso-0.57.1 by  doxygen 1.8.5