25 #ifndef UQ_MULTI_LEVEL_SAMPLING_LEVEL_OPTIONS_H 
   26 #define UQ_MULTI_LEVEL_SAMPLING_LEVEL_OPTIONS_H 
   28 #define LEVEL_REF_ID 0 
   30 #include <queso/Environment.h> 
   31 #include <queso/SequenceStatisticalOptions.h> 
   32 #include <queso/BoostInputOptionsParser.h> 
   33 #define UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE "." 
   36 #define UQ_ML_SAMPLING_L_HELP                                                 "" 
   37 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY 
   39 #define UQ_ML_SAMPLING_L_CHECKPOINT_OUTPUT_FILE_NAME_ODV                      UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   41 #define UQ_ML_SAMPLING_L_STOP_AT_END_ODV                                      0 
   42 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_FILE_NAME_ODV                            UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   43 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_ALLOW_ALL_ODV                            0 
   44 #define UQ_ML_SAMPLING_L_DATA_OUTPUT_ALLOWED_SET_ODV                          "" 
   45 #define UQ_ML_SAMPLING_L_LOAD_BALANCE_ALGORITHM_ID_ODV                        2 
   46 #define UQ_ML_SAMPLING_L_LOAD_BALANCE_TRESHOLD_ODV                            1. 
   47 #define UQ_ML_SAMPLING_L_MIN_EFFECTIVE_SIZE_RATIO_ODV                         0.85 
   48 #define UQ_ML_SAMPLING_L_MAX_EFFECTIVE_SIZE_RATIO_ODV                         0.91 
   49 #define UQ_ML_SAMPLING_L_SCALE_COV_MATRIX_ODV                                 1 
   50 #define UQ_ML_SAMPLING_L_MIN_REJECTION_RATE_ODV                               0.50 
   51 #define UQ_ML_SAMPLING_L_MAX_REJECTION_RATE_ODV                               0.75 
   52 #define UQ_ML_SAMPLING_L_COV_REJECTION_RATE_ODV                               0.25 
   53 #define UQ_ML_SAMPLING_L_MIN_ACCEPTABLE_ETA_ODV                               0. 
   54 #define UQ_ML_SAMPLING_L_TOTALLY_MUTE_ODV                                     1 
   55 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_DATA_INPUT_FILE_NAME_ODV            UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   56 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_DATA_INPUT_FILE_TYPE_ODV            UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT 
   57 #define UQ_ML_SAMPLING_L_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_NAME_ODV UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   58 #define UQ_ML_SAMPLING_L_INITIAL_PROPOSAL_COV_MATRIX_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT 
   59 #define UQ_ML_SAMPLING_L_INITIAL_POSITION_USE_PREVIOUS_LEVEL_LIKELIHOOD_ODV   0 
   60 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_INPUT_FILE_NAME_ODV                   UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   61 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_INPUT_FILE_TYPE_ODV                   UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT 
   62 #define UQ_ML_SAMPLING_L_LIST_OF_DISABLED_PARAMETERS_ODV                      "" 
   63 #define UQ_ML_SAMPLING_L_INITIAL_VALUES_OF_DISABLED_PARAMETERS_ODV            "" 
   64 #define UQ_ML_SAMPLING_L_RAW_CHAIN_SIZE_ODV                                   100 
   65 #define UQ_ML_SAMPLING_L_RAW_CHAIN_GENERATE_EXTRA_ODV                         0 
   66 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DISPLAY_PERIOD_ODV                         500 
   67 #define UQ_ML_SAMPLING_L_RAW_CHAIN_MEASURE_RUN_TIMES_ODV                      1 
   68 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_PERIOD_ODV                     0 
   69 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_FILE_NAME_ODV                  UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   70 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV                  UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT 
   71 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV                  0 
   72 #define UQ_ML_SAMPLING_L_RAW_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV                "" 
   73 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS 
   74 #define UQ_ML_SAMPLING_L_RAW_CHAIN_COMPUTE_STATS_ODV                          0 
   76 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_GENERATE_ODV                          0 
   77 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DISCARDED_PORTION_ODV                 0. 
   78 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_LAG_ODV                               1 
   79 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_FILE_NAME_ODV             UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   80 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_FILE_TYPE_ODV             UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT 
   81 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_ALLOW_ALL_ODV             0 
   82 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_DATA_OUTPUT_ALLOWED_SET_ODV           "" 
   83 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS 
   84 #define UQ_ML_SAMPLING_L_FILTERED_CHAIN_COMPUTE_STATS_ODV                     0 
   86 #define UQ_ML_SAMPLING_L_DISPLAY_CANDIDATES_ODV                               0 
   87 #define UQ_ML_SAMPLING_L_PUT_OUT_OF_BOUNDS_IN_CHAIN_ODV                       1 
   88 #define UQ_ML_SAMPLING_L_TK_USE_LOCAL_HESSIAN_ODV                             0 
   89 #define UQ_ML_SAMPLING_L_TK_USE_NEWTON_COMPONENT_ODV                          1 
   90 #define UQ_ML_SAMPLING_L_DR_MAX_NUM_EXTRA_STAGES_ODV                          0 
   91 #define UQ_ML_SAMPLING_L_DR_LIST_OF_SCALES_FOR_EXTRA_STAGES_ODV               "1." 
   92 #define UQ_ML_SAMPLING_L_DR_DURING_AM_NON_ADAPTIVE_INT_ODV                    1 
   93 #define UQ_ML_SAMPLING_L_AM_KEEP_INITIAL_MATRIX_ODV                           0 
   94 #define UQ_ML_SAMPLING_L_AM_INIT_NON_ADAPT_INT_ODV                            0 
   95 #define UQ_ML_SAMPLING_L_AM_ADAPT_INTERVAL_ODV                                0 
   96 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_PERIOD_ODV           0 
   97 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_NAME_ODV        UQ_ML_SAMPLING_L_FILENAME_FOR_NO_FILE 
   98 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_FILE_TYPE_ODV        UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT 
   99 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOW_ALL_ODV        0 
  100 #define UQ_ML_SAMPLING_L_AM_ADAPTED_MATRICES_DATA_OUTPUT_ALLOWED_SET_ODV      "" 
  101 #define UQ_ML_SAMPLING_L_AM_ETA_ODV                                           1. 
  102 #define UQ_ML_SAMPLING_L_AM_EPSILON_ODV                                       1.e-5 
  103 #define UQ_ML_SAMPLING_L_DO_LOGIT_TRANSFORM                                   0 
  104 #define UQ_ML_SAMPLING_L_ALGORITHM                                            "random_walk" 
  105 #define UQ_ML_SAMPLING_L_TK                                                   "random_walk" 
  147   void print            (std::ostream& os) 
const;
 
  154 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY 
  264 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS 
  265   bool                               m_rawChainComputeStats;
 
  267   SequenceStatisticalOptions*        m_rawChainStatisticalOptionsObj;
 
  268   bool                               m_rawChainStatOptsInstantiated;
 
  292 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS 
  293   bool                               m_filteredChainComputeStats;
 
  295   SequenceStatisticalOptions*        m_filteredChainStatisticalOptionsObj;
 
  296   bool                               m_filteredChainStatOptsInstantiated;
 
  370 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
  372 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
  376 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY 
  415 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS 
  416   std::string                   m_option_rawChain_computeStats;
 
  426 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS 
  427   std::string                   m_option_filteredChain_computeStats;
 
  453   friend std::ostream & 
operator<<(std::ostream & os,
 
  460 #endif // UQ_MULTI_LEVEL_SAMPLING_LEVEL_OPTIONS_H 
double m_filteredChainDiscardedPortion
Initial discarded portion for chain filtering. 
 
std::string m_option_am_adaptedMatrices_dataOutputAllowAll
 
std::string m_option_rawChain_size
 
void copyOptionsValues(const MLSamplingLevelOptions &srcOptions)
Copies the option values from srcOptions to this. 
 
std::string m_option_totallyMute
 
double m_maxEffectiveSizeRatio
Maximum allowed effective size ratio wrt previous level. 
 
double m_amEta
'am' eta. 
 
bool m_drDuringAmNonAdaptiveInt
Whether or not 'dr' is used during 'am' non adaptive interval. 
 
bool m_filteredChainGenerate
Whether or not to generate filtered chain. 
 
double m_amEpsilon
'am' epsilon. 
 
bool m_rawChainGenerateExtra
Generate extra information about raw chain. 
 
std::string m_option_dr_duringAmNonAdaptiveInt
 
std::string m_option_rawChain_generateExtra
 
std::string m_option_maxEffectiveSizeRatio
 
std::string m_option_initialPosition_dataInputFileName
 
std::string m_option_dr_maxNumExtraStages
 
virtual ~MLSamplingLevelOptions()
Destructor. 
 
std::string m_option_rawChain_dataInputFileName
 
std::string m_option_loadBalanceTreshold
 
std::string m_option_initialProposalCovMatrix_dataInputFileType
 
double m_covRejectionRate
c.o.v. for judging attempted rejection rate at current level. 
 
std::string m_option_minAcceptableEta
 
std::string m_option_algorithm
 
double m_minEffectiveSizeRatio
Minimum allowed effective size ratio wrt previous level. 
 
std::string m_option_checkpointOutputFileName
 
bool m_putOutOfBoundsInChain
Put 'out of bound' candidates in chain as well. 
 
std::string m_initialProposalCovMatrixDataInputFileType
Type of input file for initial proposal covariance matrix. 
 
std::string m_dataOutputFileName
Name of generic output file. 
 
std::string m_tk
Which transition kernel to use for sampling. 
 
std::string m_option_loadBalanceAlgorithmId
 
std::string m_option_minRejectionRate
 
double m_minRejectionRate
minimum allowed attempted rejection rate at current level 
 
std::string m_option_covRejectionRate
 
std::string m_option_rawChain_dataOutputPeriod
 
std::string m_option_filteredChain_dataOutputAllowAll
 
std::string m_option_minEffectiveSizeRatio
 
bool m_initialPositionUsePreviousLevelLikelihood
Use previous level likelihood for initial chain position instead of re-computing it from target pdf...
 
std::string m_option_am_adaptedMatrices_dataOutputFileType
 
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
 
std::string m_option_am_keepInitialMatrix
 
std::string m_option_dataOutputAllowAll
 
std::set< unsigned int > m_rawChainDataOutputAllowedSet
subEnvs that will write to output file for raw chain. 
 
void checkOptions(const BaseEnvironment *env)
 
unsigned int m_rawChainSize
Size of raw chain. 
 
std::string m_initialPositionDataInputFileType
Type of input file for initial position. 
 
bool m_scaleCovMatrix
Whether or not scale proposal covariance matrix. 
 
unsigned int m_filteredChainLag
Spacing for chain filtering. 
 
std::string m_option_am_adaptedMatrices_dataOutputPeriod
 
std::string m_option_rawChain_dataOutputFileName
 
std::set< unsigned int > m_amAdaptedMatricesDataOutputAllowedSet
subEnvs that will write to output file for 'am' adapted matrices. 
 
std::string m_option_dataOutputFileName
 
bool m_dataOutputAllowAll
subEnvs that will write to generic output file. 
 
bool m_doLogitTransform
Whether or not a logit transform will be done for bounded domains. 
 
std::string m_amAdaptedMatricesDataOutputFileType
Type of output file for 'am' adapted matrices. 
 
std::string m_option_dr_listOfScalesForExtraStages
 
std::string m_option_help
 
std::string m_option_stopAtEnd
 
std::string m_option_rawChain_dataInputFileType
 
std::string m_option_tk_useLocalHessian
 
double m_loadBalanceTreshold
Perform load balancing if load unbalancing ratio > threshold. 
 
std::string m_option_scaleCovMatrix
 
bool m_tkUseNewtonComponent
Whether or not 'proposal' uses Newton component. 
 
std::string m_option_am_adaptedMatrices_dataOutputFileName
 
bool m_rawChainMeasureRunTimes
Whether or not to measure run times. 
 
std::string m_option_am_epsilon
 
unsigned int m_drMaxNumExtraStages
'dr' maximum number of extra stages. 
 
double m_minAcceptableEta
minimum acceptable eta, 
 
std::set< unsigned int > m_parameterDisabledSet
 
friend std::ostream & operator<<(std::ostream &os, const MLSamplingLevelOptions &obj)
 
std::string m_option_doLogitTransform
 
bool m_totallyMute
Whether or not to be totally mute (no printout message). 
 
bool m_tkUseLocalHessian
Whether or not 'proposal' uses local Hessian. 
 
std::string m_option_rawChain_dataOutputAllowedSet
 
std::string m_option_initialProposalCovMatrix_dataInputFileName
 
std::string m_rawChainDataOutputFileName
Name of output file for raw chain. 
 
std::string m_option_filteredChain_dataOutputAllowedSet
 
std::string m_option_maxRejectionRate
 
double m_maxRejectionRate
maximum allowed attempted rejection rate at current level. 
 
std::string m_option_am_eta
 
This class provides options for each level of the Multilevel sequence generator if no input file is a...
 
bool m_stopAtEnd
Stop at end of such level. 
 
std::string m_option_am_initialNonAdaptInterval
 
std::string m_rawChainDataInputFileType
Type of input file for raw chain. 
 
const BaseEnvironment & env() const 
Access to the environment. 
 
std::string m_option_am_adaptedMatrices_dataOutputAllowedSet
 
std::string m_option_filteredChain_generate
 
std::string m_checkpointOutputFileName
Name of checkpoint output file. 
 
bool m_displayCandidates
Display candidates generated in the core MH algorithm. 
 
std::set< unsigned int > m_dataOutputAllowedSet
subEnvs that will write to generic output file. 
 
std::string m_help
If non-empty string, print options and values to output file. 
 
std::string m_option_rawChain_measureRunTimes
 
std::vector< double > m_drScalesForExtraStages
'dr' list of scales for proposal covariance matrices from 2nd stage on. 
 
std::string m_option_putOutOfBoundsInChain
 
std::string m_option_rawChain_displayPeriod
 
std::string m_option_dataOutputAllowedSet
 
std::string m_option_tk_useNewtonComponent
 
std::string m_option_rawChain_dataOutputFileType
Option name for MLSamplingLevelOptions::m_rawChainDataOutputFileType. Option name is m_prefix + "ml_r...
 
std::string m_filteredChainDataOutputFileType
Type of output file for filtered chain. 
 
std::string m_option_displayCandidates
 
std::string m_filteredChainDataOutputFileName
Name of output file for filtered chain. 
 
std::string m_str1
subEnvs that will write to generic output file. 
 
std::string m_option_initialValuesOfDisabledParameters
 
void print(std::ostream &os) const 
 
std::string m_rawChainDataOutputFileType
Type of output file for raw chain. 
 
std::string m_initialProposalCovMatrixDataInputFileName
Name of input file for initial proposal covariance matrix. 
 
std::string m_option_am_adaptInterval
 
std::string m_option_listOfDisabledParameters
 
unsigned int m_rawChainDataOutputPeriod
Period of message display during raw chain generation. 
 
void scanOptionsValues(const MLSamplingLevelOptions *defaultOptions)
 
BoostInputOptionsParser * m_parser
 
unsigned int m_rawChainDisplayPeriod
Period of message display during raw chain generation. 
 
std::string m_option_filteredChain_discardedPortion
 
std::set< unsigned int > m_filteredChainDataOutputAllowedSet
subEnvs that will write to output file for filtered chain. 
 
std::string m_option_filteredChain_lag
 
unsigned int m_amAdaptInterval
'am' adaptation interval. 
 
unsigned int m_amAdaptedMatricesDataOutputPeriod
Period for outputing 'am' adapted matrices. 
 
const BaseEnvironment & m_env
 
std::string m_option_filteredChain_dataOutputFileType
 
unsigned int m_loadBalanceAlgorithmId
Perform load balancing with chosen algorithm (0 = no balancing). 
 
std::string m_amAdaptedMatricesDataOutputFileName
Name of output file for 'am' adapted matrices. 
 
std::string m_rawChainDataInputFileName
Name of input file for raw chain. 
 
bool m_amAdaptedMatricesDataOutputAllowAll
Whether or not subEnvs will write to output file for 'am' adapted matrices. 
 
bool m_rawChainDataOutputAllowAll
Whether or not subEnvs will write to output file for raw chain. 
 
std::string m_algorithm
Which algorithm to use for sampling. 
 
std::string m_option_filteredChain_dataOutputFileName
 
std::string m_option_initialPositionUsePreviousLevelLikelihood
 
std::string m_option_rawChain_dataOutputAllowAll
 
std::string m_initialPositionDataInputFileName
Name of input file for initial position. 
 
bool m_filteredChainDataOutputAllowAll
Whether or not subEnvs will write to output file for filtered chain. 
 
std::vector< double > m_initialValuesOfDisabledParameters
 
MLSamplingLevelOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file. 
 
bool m_amKeepInitialMatrix
Whether or not 'am' will keep initial (given) matrix. 
 
unsigned int m_amInitialNonAdaptInterval
'am' initial non adaptation interval 
 
std::string m_option_initialPosition_dataInputFileType