Parameter Plots

Parameter plots in chi are intended to illustrate parameter inference results derived with a InferenceController.

Functional classes

Detailed API

class chi.plots.MarginalPosteriorPlot[source]

A figure class that visualises the marginal posterior probability for each parameter across individuals.

One figure is generated for each parameter, which contains a marginal histogram of the sampled parameter values for each individual. The estimates for each indiviudal are plotted next to each other.

This figure can be used to assess the convergence of the sampling method, as well as the variation of parameter estimates across individuals.

Extends MultiFigure.

add_data(data)[source]

Adds marginal histograms of the samples across runs to the figure.

The histograms of population parameters are visualised in separate figures, while the individual parameters for one parameter type are grouped together.

Parameters:

data (xarray.Dataset) – A xarray.Dataset with the posterior samples.

show()

Displays the figures.

class chi.plots.ParameterEstimatePlot[source]

A figure class that visualises parameter maximum a posteriori probability estimates across multiple optimisation runs.

One figure is generated for each parameter, which contains a box plot of the parameter estimates across multiple optmisation runs. The estimates for each indiviudal are plotted next to each other.

This figure can be used to assess the stability of the optimisation results, as well as the variation of parameter estimates across individuals.

Extends MultiFigure.

add_data(data, id_key='ID', param_key='Parameter', est_key='Estimate', score_key='Score', run_key='Run')[source]

Adds box plots of the estimates across runs to the figure. The estimates are grouped by the individual ID.

Parameters:
  • data – A pandas.DataFrame with the parameter estimates in form of an ID, parameter, estimate, score, and run column.

  • id_key – Key label of the DataFrame which specifies the ID column. The ID refers to the identity of an individual. Defaults to 'ID'.

  • param_key – Key label of the DataFrame which specifies the parameter name column. Defaults to 'Parameter'.

  • est_key – Key label of the DataFrame which specifies the parameter estimate column. Defaults to 'Estimate'.

  • score_key – Key label of the DataFrame which specifies the score estimate column. The score refers to the maximum a posteriori probability associated with the estimate. Defaults to 'Score'.

  • run_key – Key label of the DataFrame which specifies the optimisation run column. Defaults to 'Run'.

show()

Displays the figures.