class_docstr: The kalmanFilter class the provide the basic functionalities
  
  Attributes:
      discount: the discounting factor determining how much information to carry on
      updateInnovation: indicate whether the innovation matrix should be updated.
                        default to True.
  
  Methods:
      predict: predict one step ahead of the current state
      forwardFilter: one step filter on the model given a new observation
      backwardSmoother: one step backward smooth given the future model and the
                        filtered state and systematic covariance
      backwardSampler: similar to backwardSmoother, using sampling instead of
                       deterministic equations.
      updateDiscount: for updating the discount factors
class_docstr_tok: ["The","kalmanFilter","class","the","provide","the","basic","functionalities","Attributes",":","discount",":","the","discounting","factor","determining","how","much","information","to","carry","on","updateInnovation",":","indicate","whether","the","innovation","matrix","should","be","updated",".","default","to","True",".","Methods",":","predict",":","predict","one","step","ahead","of","the","current","state","forwardFilter",":","one","step","filter","on","the","model","given","a","new","observation","backwardSmoother",":","one","step","backward","smooth","given","the","future","model","and","the","filtered","state","and","systematic","covariance","backwardSampler",":","similar","to","backwardSmoother",",","using","sampling","instead","of","deterministic","equations",".","updateDiscount",":","for","updating","the","discount","factors"]
docstr: Predict the next states of the model by one step
  
  Args:
      model: the @baseModel class provided all necessary information
      dealWithMissingValue: indicate whether we need to treat the missing value.
                            it will be turned off when used in forwardFilter as
                            missing cases have already been address by forwardFilter
  Returns:
      The predicted result is stored in 'model.prediction'
docstr_tok: ["Predict","the","next","states","of","the","model","by","one","step","Args",":","model",":","the","@","baseModel","class","provided","all","necessary","information","dealWithMissingValue",":","indicate","whether","we","need","to","treat","the","missing","value",".","it","will","be","turned","off","when","used","in","forwardFilter","as","missing","cases","have","already","been","address","by","forwardFilter","Returns",":","The","predicted","result","is","stored","in","'model.prediction","'"]
code: def predict(self, model, dealWithMissingEvaluation=False):
      """Predict the next states of the model by one step
  
      Args:
          model: the @baseModel class provided all necessary information
          dealWithMissingValue: indicate whether we need to treat the missing value.
                                it will be turned off when used in forwardFilter as
                                missing cases have already been address by forwardFilter
      Returns:
          The predicted result is stored in 'model.prediction'
  
      """
      # check whether evaluation has missing data, if so, we need to take care of it
      if dealWithMissingEvaluation:
          loc = self._modifyTransitionAccordingToMissingValue(model)
  
      # if the step number == 0, we use result from the model state
      if model.prediction.step == 0:
          model.prediction.state = np.dot(model.transition, model.state)
          model.prediction.obs = np.dot(
              model.evaluation, model.prediction.state
          )
          model.prediction.sysVar = np.dot(
              np.dot(model.transition, model.sysVar), model.transition.T
          )
  
          # update the innovation
          if self.updateInnovation == "whole":
              self.__updateInnovation__(model)
          elif self.updateInnovation == "component":
              self.__updateInnovation2__(model)
  
          # add the innovation to the system variance
          model.prediction.sysVar += model.innovation
  
          model.prediction.obsVar = (
              np.dot(
                  np.dot(model.evaluation, model.prediction.sysVar),
                  model.evaluation.T,
              )
              + model.noiseVar
          )
          model.prediction.step = 1
  
      # otherwise, we use previous result to predict next time stamp
      else:
          model.prediction.state = np.dot(
              model.transition, model.prediction.state
          )
          model.prediction.obs = np.dot(
              model.evaluation, model.prediction.state
          )
          model.prediction.sysVar = np.dot(
              np.dot(model.transition, model.prediction.sysVar),
              model.transition.T,
          )
          model.prediction.obsVar = (
              np.dot(
                  np.dot(model.evaluation, model.prediction.sysVar),
                  model.evaluation.T,
              )
              + model.noiseVar
          )
          model.prediction.step += 1
  
      # recover the evaluation and the transition matrix
      if dealWithMissingEvaluation:
          self._recoverTransitionAndEvaluation(model, loc)
  
file_path: pydlm/pydlm/base/kalmanFilter.py
imports: import numpy
  import pydlm.base.tools
label_desc: Use image node_id 2 for calling the kalmanFilter obj's underlying member method code with example usage: obj.predict(model, dealWithMissingEvaluation) without return types