code: def miso_lfilter(ar, ma, x, useic=False):
      """
      Filter multiple time series into a single time series.
  
      Uses a convolution to merge inputs, and then lfilter to produce output.
  
      Parameters
      ----------
      ar : array_like
          The coefficients of autoregressive lag polynomial including lag zero,
          ar(L) in the expression ar(L)y_t.
      ma : array_like, same ndim as x, currently 2d
          The coefficient of the moving average lag polynomial, ma(L) in
          ma(L)x_t.
      x : array_like
          The 2-d input data series, time in rows, variables in columns.
      useic : bool
          Flag indicating whether to use initial conditions.
  
      Returns
      -------
      y : ndarray
          The filtered output series.
      inp : ndarray, 1d
          The combined input series.
  
      Notes
      -----
      currently for 2d inputs only, no choice of axis
      Use of signal.lfilter requires that ar lag polynomial contains
      floating point numbers
      does not cut off invalid starting and final values
  
      miso_lfilter find array y such that:
  
              ar(L)y_t = ma(L)x_t
  
      with shapes y (nobs,), x (nobs, nvars), ar (narlags,), and
      ma (narlags, nvars).
      """
      ma = array_like(ma, "ma")
      ar = array_like(ar, "ar")
      inp = signal.correlate(x, ma[::-1, :])[:, (x.shape[1] + 1) // 2]
      # for testing 2d equivalence between convolve and correlate
      #  inp2 = signal.convolve(x, ma[:,::-1])[:, (x.shape[1]+1)//2]
      #  np.testing.assert_almost_equal(inp2, inp)
      nobs = x.shape[0]
      # cut of extra values at end
  
      # TODO: initialize also x for correlate
      if useic:
          return (
              signal.lfilter(
                  [1],
                  ar,
                  inp,
                  zi=signal.lfiltic(np.array([1.0, 0.0]), ar, useic),
              )[0][:nobs],
              inp[:nobs],
          )
      else:
          return signal.lfilter([1], ar, inp)[:nobs], inp[:nobs]
  
file_path: statsmodels/statsmodels/tsa/filters/filtertools.py
imports: import numpy
  import scipy.fftpack
  from scipy import signal
  from statsmodels.tools.validation import array_like, PandasWrapper
label_desc: Use image node_id 6 for calling a global function with example usage: miso_lfilter(ar, ma, x, useic) and returns: signal,  inp, signal,  inp