kde_cpi.output.plots module

Plotting tools for CPI metrics.

class kde_cpi.output.plots.DensityPlotConfig(title='KDE Mode Inflation', xlabel='Percent', ylabel='Density', color='#d08300', rug_alpha=0.3, line_width=2.5, statistic_line_style=None)[source]

Bases: object

Styling and annotation options for kernel density plots.

Parameters:
color: str = '#d08300'
line_width: float = 2.5
rug_alpha: float = 0.3
statistic_line_style: dict[str, dict[str, object]] | None = None
title: str = 'KDE Mode Inflation'
xlabel: str = 'Percent'
ylabel: str = 'Density'
class kde_cpi.output.plots.HistogramPlotConfig(title='Weighted Distribution', xlabel='Percent', ylabel='Weighted frequency', bins=30, color='#126782', alpha=0.6)[source]

Bases: object

Configuration values for weighted histogram plots.

Parameters:
alpha: float = 0.6
bins: int = 30
color: str = '#126782'
title: str = 'Weighted Distribution'
xlabel: str = 'Percent'
ylabel: str = 'Weighted frequency'
class kde_cpi.output.plots.PlotReport(path, statistics)[source]

Bases: object

Metadata describing a saved plot and its computed statistics.

Parameters:
path: Path
statistics: StatSummary
kde_cpi.output.plots.generate_density_plot(values, weights, *, output_dir='out', filename='density.png', config=None)[source]

Render a kernel density estimate with summary annotations.

Return type:

PlotReport

Parameters:
kde_cpi.output.plots.generate_histogram_plot(values, weights, *, output_dir='out', filename='histogram.png', config=None)[source]

Render a weighted histogram with key summary markers.

Return type:

PlotReport

Parameters: