code: def test_odd_length_filter(self):
      start = datetime(1951, 3, 31)
      end = datetime(1958, 12, 31)
      x = self.data[0]
      res = convolution_filter(x, [0.75, 0.5, 0.3, 0.2, 0.1])
      expected = self.expected.conv2_odd
      np.testing.assert_almost_equal(res.values.squeeze(), expected)
      np.testing.assert_(res.index[0] == start)
      np.testing.assert_(res.index[-1] == end)
  
      res = convolution_filter(x, [0.75, 0.5, 0.3, 0.2, 0.1], nsides=1)
      expected = self.expected.conv1_odd
      np.testing.assert_almost_equal(res.values.squeeze(), expected)
      np.testing.assert_(res.index[0] == start)
      np.testing.assert_(res.index[-1] == end)
      # with no NAs
  
      # not a stable filter
      res = recursive_filter(
          x, [0.75, 0.5, 0.3, 0.2, 0.1], init=[150, 100, 125, 135, 145]
      )
      expected = self.expected.recurse_odd
      # only have 12 characters in R and this blows up and gets big
      np.testing.assert_almost_equal(res.values.squeeze(), expected, 4)
      np.testing.assert_(res.index[0] == start)
      np.testing.assert_(res.index[-1] == end)
  
imports: from statsmodels.compat.pandas import QUARTER_END, assert_frame_equal, make_dataframe
  from datetime import datetime
  import numpy
  from numpy import array, column_stack
  from numpy.testing import assert_, assert_allclose, assert_almost_equal, assert_equal, assert_raises
  from pandas import DataFrame, concat, date_range
  from statsmodels.datasets import macrodata
  from statsmodels.tsa.filters._utils import pandas_wrapper
  from statsmodels.tsa.filters.bk_filter import bkfilter
  from statsmodels.tsa.filters.cf_filter import cffilter
  from statsmodels.tsa.filters.filtertools import convolution_filter, recursive_filter
  from statsmodels.tsa.filters.hp_filter import hpfilter
label_desc: Use image node_id 7 for calling the TestFilters obj's underlying member method code with example usage: obj.test_odd_length_filter() without return types