βα° plotting.acf_pacfΒΆ
The AcfPacfPlotter class provides functionality to visualize the Auto-Correlation Function (ACF)
and Partial Auto-Correlation Function (PACF) for time series data. This module is designed to
help users understand the correlation structure of their time series data by generating informative plots.
OverviewΒΆ
The module exposes a plotter class that:
Accepts a pandas DataFrame or Series
Plots ACF and PACF for selected columns or series
Supports configurable lag values and plot customization
Leverages matplotlib and statsmodels for visualization
Class ReferenceΒΆ
- class owlmix.plotting.acf_pacf.AcfPacfPlotParams(columns=None, n_lags=10, precision=4)ΒΆ
Dataclass for specifying ACF/PACF plotting parameters.
- class owlmix.plotting.acf_pacf.AcfPacfPlotter(data, params)ΒΆ
Plots the Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) for specified columns in a pandas DataFrame or a single Series.
- Parameters:
data (
pandas.DataFrameorpandas.Series) β Input DataFrame or Series containing time series data.params (
AcfPacfPlotParams) β Configuration parameters for ACF/PACF plotting.
- generate(output_dir: str = 'outputs/charts') strΒΆ
Generates and saves ACF and PACF plots for each specified column or series.
- Parameters:
output_dir (
str) β Directory to save the generated plots.- Returns:
File path to the saved ACF and PACF chart image.
- Return type:
str
Sample OutputΒΆ
ACF and PACF plot typically consists of two subplots: the upper subplot shows the ACF values for each lag, while the lower subplot shows the PACF values. Each bar represents the correlation at a specific lag, and horizontal lines indicate confidence intervals. Significant correlations outside these intervals suggest potential patterns in the time series data.