code: def testGetResidual(self):
      # for forward filter
      filter_type = "forwardFilter"
      self.dlm5.fitForwardFilter()
      filteredTrend = self.dlm5.getMean(filterType=filter_type)
      filteredResidual = self.dlm5.getResidual(filterType=filter_type)
      self.assertEqual(len(filteredResidual), self.dlm5.n)
      diff = 0.0
      for i in range(len(filteredTrend)):
          diff += abs(
              -filteredTrend[i]
              - filteredResidual[i]
              + self.dlm5.data[i]
          )
      self.assertAlmostEqual(diff, 0)
  
      # for backward smoother
      filter_type = "backwardSmoother"
      self.dlm5.fitBackwardSmoother()
      filteredTrend = self.dlm5.getMean(filterType=filter_type)
      filteredResidual = self.dlm5.getResidual(filterType=filter_type)
      diff = 0.0
      for i in range(len(filteredTrend)):
          diff += abs(
              -filteredTrend[i]
              - filteredResidual[i]
              + self.dlm5.data[i]
          )
      self.assertAlmostEqual(diff, 0)
  
imports: import numpy
  import unittest
  from pydlm.modeler.trends import trend
  from pydlm.modeler.seasonality import seasonality
  from pydlm.modeler.dynamic import dynamic
  from pydlm.modeler.autoReg import autoReg
  from pydlm.dlm import dlm
label_desc: Use image node_id 26 for calling the testDlm obj's underlying member method code with example usage: obj.testGetResidual() without return types