(calibration_markov_chain_diagnostics_draw_trace)= # Drawing the trace This method is used to visualise the trace of the chains, i.e., the evolution of parameter values across iterations. It should be used to check the stability of the chains (stability of the mean and variance, see {{metho}}), and to detect potential autocorrelation (when the chain moves too slowly within the target distribution). Thus, trace plots provide a first indication of the appropriate **burn-in** (the number of iterations to discard before stability is reached) and **lag** (the number of iterations to skip to reduce autocorrelation). The prototype is: ````{only} cpp ```cpp void drawTrace(TString sTitre, const char *variable = "*", Option_t * option = ""); ``` ```` ````{only} py ```python drawTrace(sTitre, variable = "*", option = "") ``` ```` This method takes up to three arguments, two of which are optional: 1. **sTitre**: the title of the plot (an empty string is allowed); 2. **variable** (optional): a list of parameter names to be drawn, separated by colons ":". The default `"*"` draws all parameters; 3. **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; Returning to the example in [](#use_cases_macro_calibration_mcmc), the trace plots (shown in {numref}`usecases_calibrationMCMCFlowrate1D_Tr`) reveal that the very beginning of the chain is unstable, likely because initialization was far from the most probable value. Afterward, the behavior stabilizes, oscillating around what appears to be the most probable region. Based on this, a small burn-in of about 10 iterations could be chosen. Looking at the acceptance ratio plot (see {numref}`usecases_calibrationMCMCFlowrate1D_Acc`), however, suggests that the burn-in should be slightly larger. Therefore, we set a value of 50 for the burn-in using the `setBurnin` method (see [](#calibration_markov_chain_diagnostics)). When a trace plot is drawn after defining a burn-in with `setBurnin`, the burn-in region is indicated by a black dotted line.