(calibration_classes_functions_observations_calibration_classes_draw_residuals)= # Drawing the residuals This method is used to visualize the residuals of the output variables, i.e. the discrepancies between the model predictions and the reference outputs. Two types of residuals are typically considered: - *A priori* residuals – based on the initial parameter values or the prior distribution; - *A posteriori* residuals – obtained after the calibration procedure. The prototype is: ````{only} cpp ```cpp void drawResiduals(TString sTitre, const char *variable = "*", const char *select="1>0", Option_t * option = ""); ``` ```` ````{only} py ```python drawResiduals(sTitre, variable = "*", select="1>0", option = "") ``` ```` It takes up to four arguments, three of which are optional: 1. **sTitre**: the title of the plot (an empty string is allowed); 2. **variable** (optional): a list of parameter names for which one wants to draw the residuals, separated by colons ":". The default **"*"** draws all parameters; 3. **select** (optional): a selection expression that filters out configurations. For example, it can be used to exclude the *burn-in* period or to apply *lag* procedures in the MCMC algorithms (see [](#calibration_markov_chain)); 4. **option** (optional): a list of options, separated by commas "," to adjust the plotting behavior: - **"nonewcanvas"**: draw on the current canvas (instead of creating a new one); - **"vertical"**: if multiple parameters are plotted, display them stacked vertically (one per row). By default, plots are arranged horizontally, side by side; - **"apriori/aposteriori"**: draw only the *a priori* residuals or only the *a posteriori* residuals. If neither option is specified, both are displayed; - **"custom=XXX"**: also draw custom residuals computed with `estimateCustomResiduals`. For example, using the custom set "set1" defined earlier (see [](#calibration_classes_functions_observations_calibration_classes_estimate_residuals)), one can compare *a priori*, *a posteriori*, and custom residuals: ````{only} cpp ```cpp mycal->drawResiduals("Residuals title", "*", "", "nonewcanvas,apriori,aposteriori,custom=set1"); ``` ```` ````{only} py ```python mycal.drawResiduals("Residuals title", "*", "", "nonewcanvas,apriori,aposteriori,custom=set1") ``` ````