11.2.3. Common methods of the calibration classes
All calibration classes that derive from TCalibration share many common methods, and their
organisation has been streamlined as much as possible. This section describes the shared
code to avoid repetition in the later sections, which cover each specific calibration
method (from Minimisation techniques to Markov chain Monte Carlo approach).
The subsections from Construction with a TRun to Construction for a function with the Launcher architecture discuss the different constructors, explaining the various ways the model can be provided and their implications while Running the estimate provides a glimpse of the shared possible options that can be defined and their purpose. Finally, Drawing the parameters and Drawing the residuals introduce the drawing methods in principle (though illustrations are postponed to dedicated sections of this documentation).
Warning
As with some earlier discussions, the following methods are common to all classes inheriting from
TCalibration. For illustration, the examples will use an instance cal
of the fictitious class TCalClass (as if it inherited from TCalibration class). A
more realistic syntax can be found in the dedicated sections (from Minimisation techniques
to Markov chain Monte Carlo approach).
Calibration classes can generally be constructed in four different ways, depending on how the model
has been specified. To estimate how close the new set of parameter values (the configuration)
produces output that are close to the reference, one needs to be able to run the model on the input variables of the reference dataset. The
input variables of the reference dataset are not the only input variables of the model used within
the calibration method, as the parameters themselves have to be specified as inputs (as they also
obviously affect the predictions). This section illustrates, using the fictitious class
TCalClass, how calibration objects can be constructed.
Summary: TCalibration and TDistanceLikelihoodFunction
In summary, a calibration analysis should always follow these key steps:
Define both the parameter (
tdsPar) and reference (tdsRef) objects, as explained in General introduction to data and model definition.Define the model architecture (either Relauncher or Launcher-based) and the evaluator kind (code, C++-function, python-function…). Particular attention is needed when specifying the input and output attributes (the former should be an admixture of attributes from
tdsParandtdsRef, as explained in General introduction to data and model definition.Define the
TCalibration-inheriting object (meaning the underlying method chosen for this analysis) and construct it (see from Construction with a TRun to Construction for a function with the Launcher architecture).Define the
TDistanceLikelihoodFunction-inheriting object by callingsetDistanceorsetLikelihood(depending on theTCalibrationobject), see the recommended distance and likelihood functions in Recommended distance and likelihood functions, construction method.Set the method-dependent parameters (discussed in dedicated part, from Minimisation techniques to Markov chain Monte Carlo approach).
Call the
estimateParametersmethod with selected options (see Running the estimate).Perform the post-processing using method-dependent functions discussed in the dedicated sections, from Minimisation techniques to Markov chain Monte Carlo approach) and drawing methods (see also both Drawing the parameters and Drawing the residuals).