11.4.1. Constructing the TLinearBayesian object
The constructors available for creating an instance of the TLinearBayesian class are
detailed in Common methods of the calibration classes. As a reminder, the available
prototypes are:
# Constructor with a runner
TLinearBayesian(tds, runner, ns=1, option="")
# Constructor with a TCode
TLinearBayesian(tds, code, ns=1, option="")
# Constructor with a function using Launcher
TLinearBayesian(tds, fcn, varexpinput, varexpoutput, ns=1, option="")
Details about these constructors can be found in
Construction with a TRun,
Construction with a TCode, and
Construction for a function with the Launcher architecture
respectively for the TRun, TCode, and TLauncherFunction-based constructor. In all cases, the
number of samples \(ns\) is set to 1 by default, and modifying it has no effect on the
results, since it returns the analytical distributions. This class does not define any specific options.
The final step is to construct the TDistanceLikelihoodFunction, a
mandatory step that must always immediately follow the constructor. This can be done via the setLikelihood method (following the prototype presented in Recommended distance and likelihood functions, construction method).
Warning
The Analytical Linear Bayesian Estimation method relies on the assumption that residuals are Gaussian (centered) with a defined covariance matrix (see Defining the TLinearBayesian properties). As a result, the likelihood is not a free choice but is determined by these assumptions.
It is important to note that the setLikelihood method is used only for residual calculation, to compare the prior and posterior. Regardless of the initial choice of likelihood, the function is locally redefined so that the computation is performed via the lin_gauss function using matrix multiplication (through the TMahalanobisDistance method).
Although not recommended, it is still possible to define a custom likelihood function:
setLikelihood(likelihoodFunc, tdsRef, input, reference, weight="")