code: def _diff_inv_vector(x, lag, differences, xi):
      # R code: if (missing(xi)) xi < - rep(0., lag * differences)
      # R code: if (length(xi) != lag * differences)
      # R code:   stop("'xi' does not have the right length")
      if xi is None:
          xi = np.zeros(lag * differences, dtype=DTYPE)
      else:
          xi = check_endog(
              xi,
              dtype=DTYPE,
              copy=False,
              force_all_finite=False,
              preserve_series=False,
          )
          if xi.shape[0] != lag * differences:
              raise IndexError('"xi" does not have the right length')
  
      if differences == 1:
          return np.asarray(C_intgrt_vec(x=x, xi=xi, lag=lag))
      else:
          # R code: diffinv.vector(diffinv.vector(x, lag, differences - 1L,
          # R code:               diff(xi, lag=lag, differences=1L)),
          # R code:               lag, 1L, xi[1L:lag])
          return diff_inv(
              x=diff_inv(
                  x=x,
                  lag=lag,
                  differences=differences - 1,
                  xi=diff(x=xi, lag=lag, differences=1),
              ),
              lag=lag,
              differences=1,
              xi=xi[:lag],  # R: xi[1L:lag]
          )
  
file_path: pmdarima/pmdarima/utils/array.py
imports: from sklearn.utils import validation
  import numpy
  import pandas
  from ..compat import DTYPE
  from ._array import C_intgrt_vec
label_desc: Use image node_id 8 for calling a global function with example usage: _diff_inv_vector(x, lag, differences, xi) and returns: np, diff_inv