code: def _pacf(
      data: pd.Series,
      diff: int = 0,
      lags: int = 40,
      method: str = "ywadjusted",
      alpha: float = 0.05,
  ) -> pd.DataFrame:
      data_clean = data.fillna(method="bfill").fillna(method="ffill")
      lags = min(
          lags, np.floor(len(data_clean) / 2) - 2, len(data_clean)
      )
      data_clean = pd.Series(
          np.diff(data_clean.values, diff),
          index=data_clean.index[diff:],
      )
      corr, conf = sms.pacf(
          data_clean, nlags=lags, method=method, alpha=alpha
      )
      return _stattools_make_df(corr, conf)
  
file_path: tslumen/tslumen/profile/correlation.py
imports: from typing import Optional, Tuple
  import numpy
  import pandas
  from statsmodels.tsa import stattools
  from tslumen.profile.base import ProfilingFunction
label_desc: Use image node_id 3 for calling a global function with example usage: _pacf(data, diff, lags, method, alpha) and returns: _stattools_make_df