class_docstr: A dlm module containing all prediction methods.
      
docstr: N day ahead prediction based on the current data.
  
  This function is a convenient wrapper of predict() and
  continuePredict(). If the prediction is into the future, i.e, > n, 
  the featureDict has to contain all feature vectors for multiple days
  for each dynamic component. For example, assume myDLM has a component
  named 'spy' which posseses two dimensions,
  
  >>> featureDict_3day = {'spy': [[1, 2],[2, 3],[3, 4]]}
  >>> myDLM.predictN(N=3, featureDict=featureDict_3day)
  
  Args:
      N:    The length of days to predict.
      date: The index when the prediction based on. Default to the
            last day.
      FeatureDict: The feature set for the dynamic Components, in a form
            of {"component_name": feature}, where the feature must have
            N elements of feature vectors. If the featureDict is not
            supplied, then the algo reuse those stored in the dynamic
            components. For dates beyond the last day, featureDict must
            be supplied.
  
  Returns:
      A tuple of two lists. (Predicted observation, variance of the predicted
      observation)
docstr_tok: ["N","day","ahead","prediction","based","on","the","current","data",".","This","function","is","a","convenient","wrapper","of","predict","(",")","and","continuePredict","(",")",".","If","the","prediction","is","into","the","future",",","i.e",",",">","n",",","the","featureDict","has","to","contain","all","feature","vectors","for","multiple","days","for","each","dynamic","component",".","For","example",",","assume","myDLM","has","a","component","named","'spy","'","which","posseses","two","dimensions",",",">",">",">","featureDict_3day","=","{","'spy","'",":","[","[","1",",","2","]",",","[","2",",","3","]",",","[","3",",","4","]","]","}",">",">",">","myDLM.predictN","(","N=3",",","featureDict=featureDict_3day",")","Args",":","N",":","The","length","of","days","to","predict",".","date",":","The","index","when","the","prediction","based","on",".","Default","to","the","last","day",".","FeatureDict",":","The","feature","set","for","the","dynamic","Components",",","in","a","form","of","{","``","component_name","''",":","feature","}",",","where","the","feature","must","have","N","elements","of","feature","vectors",".","If","the","featureDict","is","not","supplied",",","then","the","algo","reuse","those","stored","in","the","dynamic","components",".","For","dates","beyond","the","last","day",",","featureDict","must","be","supplied",".","Returns",":","A","tuple","of","two","lists",".","(","Predicted","observation",",","variance","of","the","predicted","observation",")"]
code: def predictN(self, N=1, date=None, featureDict=None):
      """N day ahead prediction based on the current data.
  
      This function is a convenient wrapper of predict() and
      continuePredict(). If the prediction is into the future, i.e, > n,
      the featureDict has to contain all feature vectors for multiple days
      for each dynamic component. For example, assume myDLM has a component
      named 'spy' which posseses two dimensions,
  
      >>> featureDict_3day = {'spy': [[1, 2],[2, 3],[3, 4]]}
      >>> myDLM.predictN(N=3, featureDict=featureDict_3day)
  
      Args:
          N:    The length of days to predict.
          date: The index when the prediction based on. Default to the
                last day.
          FeatureDict: The feature set for the dynamic Components, in a form
                of {"component_name": feature}, where the feature must have
                N elements of feature vectors. If the featureDict is not
                supplied, then the algo reuse those stored in the dynamic
                components. For dates beyond the last day, featureDict must
                be supplied.
  
      Returns:
          A tuple of two lists. (Predicted observation, variance of the predicted
          observation)
  
      """
      if N < 1:
          raise NameError("N has to be greater or equal to 1")
      # Take care if features are numpy matrix
      if featureDict is not None:
          for name in featureDict:
              if isinstance(featureDict[name], matrix):
                  featureDict[name] = featureDict[name].tolist()
      predictedObs = []
      predictedVar = []
  
      # call predict for the first day
      getSingleDayFeature = lambda f, i: (
          {k: v[i] for k, v in f.items()} if f is not None else None
      )
      # Construct the single day featureDict
      featureDictOneDay = getSingleDayFeature(featureDict, 0)
      (obs, var) = self.predict(
          date=date, featureDict=featureDictOneDay
      )
      predictedObs.append(obs)
      predictedVar.append(var)
  
      # Continue predicting the remaining days
      for i in range(1, N):
          featureDictOneDay = getSingleDayFeature(featureDict, i)
          (obs, var) = self.continuePredict(
              featureDict=featureDictOneDay
          )
          predictedObs.append(obs)
          predictedVar.append(var)
      return (
          self._1DmatrixToArray(predictedObs),
          self._1DmatrixToArray(predictedVar),
      )
  
imports: from copy import deepcopy
  from numpy import matrix
  from pydlm.predict._dlmPredict import _dlmPredict
label_desc: Use image node_id 3 for calling the dlmPredictModule obj's underlying member method code with example usage: obj.predictN(N, date, featureDict) and returns: self,  self