class_docstr: A dlm module for all the access methods
      
class_docstr_tok: ["A","dlm","module","for","all","the","access","methods"]
docstr: get the residuals for data after filtering or smoothing.
  
  If the working dates are not (0, self.n - 1),
  then a warning will prompt stating the actual filtered dates.
  
  Args:
      filterType: the type of residuals to be returned. Could be
                  'forwardFilter', 'backwardSmoother', and 'predict'.
                  Default to 'forwardFilter'.
  
  Returns:
      A list of residuals based on the choice
docstr_tok: ["get","the","residuals","for","data","after","filtering","or","smoothing",".","If","the","working","dates","are","not","(","0",",","self.n","-","1",")",",","then","a","warning","will","prompt","stating","the","actual","filtered","dates",".","Args",":","filterType",":","the","type","of","residuals","to","be","returned",".","Could","be","'forwardFilter","'",",","'backwardSmoother","'",",","and","'predict","'",".","Default","to","'forwardFilter","'",".","Returns",":","A","list","of","residuals","based","on","the","choice"]
code: def getResidual(self, filterType="forwardFilter"):
      """get the residuals for data after filtering or smoothing.
  
      If the working dates are not (0, self.n - 1),
      then a warning will prompt stating the actual filtered dates.
  
      Args:
          filterType: the type of residuals to be returned. Could be
                      'forwardFilter', 'backwardSmoother', and 'predict'.
                      Default to 'forwardFilter'.
  
      Returns:
          A list of residuals based on the choice
  
      """
      # get the working date
      start, end = self._checkAndGetWorkingDates(filterType=filterType)
      end += 1  # To get the result for the last date.
      # get the mean for the fitlered data
      # get out of the matrix form
      if filterType == "forwardFilter":
          return self._1DmatrixToArray(
              [
                  self.data[i] - self.result.filteredObs[i]
                  for i in range(start, end)
              ]
          )
      elif filterType == "backwardSmoother":
          return self._1DmatrixToArray(
              [
                  self.data[i] - self.result.smoothedObs[i]
                  for i in range(start, end)
              ]
          )
      elif filterType == "predict":
          return self._1DmatrixToArray(
              [
                  self.data[i] - self.result.predictedObs[i]
                  for i in range(start, end)
              ]
          )
      else:
          raise NameError("Incorrect filter type.")
  
file_path: pydlm/pydlm/access/dlmAccessMod.py
imports: from copy import deepcopy
  from pydlm.base.tools import getInterval
  from pydlm.access._dlmGet import _dlmGet
label_desc: Use image node_id 4 for calling the dlmAccessModule obj's underlying member method code with example usage: obj.getResidual(filterType) and returns: self, self, self