plot_ridge#
- pyfcirt.plot_ridge(
- data: Dataset | DataTree,
- var_name='theta',
- *,
- coords=None,
- max_rows=12,
- col_wrap=4,
- ci_probs=(0.5, 0.95),
- figsize=None,
- colors=None,
Plot marginal posterior distributions with credible intervals.
Parameters#
data: xarray.Dataset or xarray.DataTreePosterior with the selected variable and at least two sampled states on the
chainanddrawaxes.var_name: strPosterior variable. Default:
"theta".coords: mapping or NoneSelect parameter labels such as
personortrait.max_rows: int or NoneRow limit after selection. Default: 12.
Noneincludes all rows.col_wrap: intMaximum panel columns. Default: 4.
ci_probs: tuple of floatCredible interval masses. Default:
(0.5, 0.95).figsize: tuple or NoneFigure size in inches.
colors: str, sequence or NoneMatplotlib color or palette.
Noneuses the default color.
Returns#
- arviz_plots.PlotCollection
Editable ridge plot. People, statements or items form rows when available. Other parameter dimensions remain facets.
Examples#
Use a fitted Model. The output below comes from the HEXACO TIRT example.
Compare Emotionality estimates for three respondents.
import pyfcirt as fc
people = model.idata.posterior.person.values[:3].tolist()
plot = fc.plot_ridge(
model.idata,
coords={"person": people, "trait": ["emotionality"]},
figsize=(5, 2.8),
)