Create diagnostic plots showing the evolution of Bias² and MSE statistics across calibration steps for one or several variables. For each variable, the curve is drawn with attenuated color before the calibration step where it is first used, then in normal color from this step onwards. Panels are ordered by the step of first use of each variable.

plot_stats_evolution(stats_per_step, steps_by_var, step_levels = NULL)

Arguments

stats_per_step

A data.frame containing at least the following columns:

  • step (character or factor): calibration step

  • variable (character): name of the variable

  • Bias2 (numeric): Bias² statistic

  • MSE (numeric): MSE statistic

steps_by_var

A named character vector associating each variable (names(steps_by_var)) to the name of the step in which it is (last) used (steps_by_var[variable]).

step_levels

(optional) Character vector giving the global order of steps. If not provided, the order of appearance in stats_per_step$step is used.

Value

A ggplot object with one facet per variable, ordered according to their step of use.