plot_param()#
- liesel.goose.summary_viz.plot_param(results, param, param_index=None, chain_indices=None, max_chains=5, max_lags=None, title=None, title_spacing=0.9, style='whitegrid', color_list=None, figure_size=(9, 6), legend_position=(1.2, 0.4), save_path=None)[source]#
Visualizes trace plot, density plot and autocorrelation plot of a single subparameter.
- Parameters:
results (
SamplingResults
) – Result object of the sampling process. Must have a methodget_posterior_samples()
which extracts all samples from the posterior distribution.param (
str
) – Name of a single model parameter that is contained in the plot. Must coincide with one dictionary key of thePosition
with the posterior samples.param_index (
Optional
[int
]) – A single index of the selected model parameter that is contained in the plot. Selects e.g.beta[0]
out of abeta
parameter vector. Can be specified as an integer or as a sequence containing one integer. IfNone
, the parameter is assumed to have only a single index. (default:None
)chain_indices (
Union
[int
,Sequence
[int
],None
]) – Indices of chains for each model subparameter that are contained in the plot. Selects e.g. chain 0 and chain 2 out of multiple chains. A single index can be specified as an integer or a sequence containing one integer. IfNone
, all chains are included. (default:None
)max_chains (
int
|None
) – Upper bound how many chains are included within each subplot/facet. Avoids overplotting. IfNone
, all chains contained in theresults
input are plotted. Always starts chain selection from the lowest chain index upwards. For selecting specific chains use the argumentchain_indices
. (default:5
)max_lags (
Optional
[int
]) – Maximum number of time lags shown on the x-axis of the autocorrelation plot. IfNone
, the minimum of the chain lengths and 30 is chosen. (default:None
)title_spacing (
float
) – Determines the margin/whitespace between the plot title (set withfig.suptitle()
) and the first row of subplots/facets. Passed to thetop
argument offig.subplots_adjust()
. (default:0.9
)style (
str
) – Passed to thestyle
argument ofsns.set_theme()
. Valid options aredarkgrid
,whitegrid
,dark
,white
, andticks
. (default:'whitegrid'
)color_list (
Optional
[list
[str
]]) – Determines the chain colors for all three subplots. Custom colors can be passed with a list of color strings. The length of the list must match the number of chains. IfNone
, the defaulttab10
matplotlib colormap is chosen. (default:None
)figure_size (
tuple
[int
|float
,int
|float
]) – Size of the entire plot grid. Passed to thefigsize
argument ofplt.figure()
. When changing the figure size consider changing thelegend_position
as well. Generally, a ratio of 3 (default:(9, 6)
)legend_position (
tuple
[float
,float
]) – Determines the color legend position. Coordinates are relative to the upper panel within the plot grid. The first coordinate specifies the horizontal, the second coordinate the vertical position. Might require an adjustment when changing thefigure_size
values or the number of chains. (default:(1.2, 0.4)
)save_path (
Optional
[str
]) – File path where the plot is saved. (default:None
)
- Return type: