petab.v1.visualize.plot_residuals

Functions for plotting residuals.

Functions

plot_goodness_of_fit(petab_problem, ...[, ...])

Plot goodness of fit.

plot_residuals_vs_simulation(petab_problem, ...)

Plot residuals versus simulation values for measurements with normal noise assumption.

petab.v1.visualize.plot_residuals.plot_goodness_of_fit(petab_problem: Problem, simulations_df: str | Path | DataFrame, size: tuple = (10, 7), color=None, ax: Axes | None = None, normalized_error: bool = True) Axes[source]

Plot goodness of fit.

Parameters:
  • petab_problem – A PEtab problem.

  • simulations_df – A simulation DataFrame in the PEtab format or path to the simulation output data file.

  • size – Figure size.

  • color – The marker colors, matches the c parameter of matplotlib.pyplot.scatter.

  • ax – Axis object.

  • normalized_error – Type of error to display. If True, mean of squared normalized residuals is shown, otherwise mean of squared residuals.

Returns:

ax

Return type:

Axis object of the created plot.

petab.v1.visualize.plot_residuals.plot_residuals_vs_simulation(petab_problem: Problem, simulations_df: str | Path | DataFrame, size: tuple | None = (10, 7), axes: tuple[Axes, Axes] | None = None) Axes[source]

Plot residuals versus simulation values for measurements with normal noise assumption.

Parameters:
  • petab_problem – A PEtab problem.

  • simulations_df – A simulation DataFrame in the PEtab format or path to the simulation output data file.

  • size – Figure size.

  • axes – Axis object.

Returns:

ax

Return type:

Axis object of the created plot.