class_docstr: Class to build a VAR model
      
class_docstr_tok: ["Class","to","build","a","VAR","model"]
docstr: Return the predictions
docstr_tok: ["Return","the","predictions"]
code: def predict(
      self,
      testdata: Optional[pd.DataFrame] = None,
      forecast_period: Optional[int] = None,
      simple: bool = True,
  ) -> NDFrame:
      """
      Return the predictions
      """
  
      if testdata is not None:
          warnings.warn(
              "You have passed exogenous variables to make predictions for a VAR model. "
              + "VAR model will predict all exogenous variables automatically, "
              + "hence your passed values will not be used."
          )
          if isinstance(testdata, pd.DataFrame) or isinstance(
              testdata, pd.Series
          ):
              if len(testdata) != self.forecast_period:
                  self.forecast_period = testdata.shape[0]
          elif isinstance(testdata, int):
              self.forecast_period = testdata
  
          forecast_period = self.forecast_period
  
      # Extract the dynamic predicted and true values of our time series
      if forecast_period is None:
          # use the forecast period used during training
          forecast_period = self.forecast_period
  
      # y_forecasted = self.model.forecast(forecast_period)
  
      res = self.model.get_forecast(forecast_period)
      res_frame = res.summary_frame()
  
      res_frame.rename(columns={"mean": "yhat"}, inplace=True)
  
      if simple:
          res_frame = res_frame["yhat"]
          res_frame = (
              res_frame.squeeze()
          )  # Convert to a pandas series object
      else:
          # Pass as is
          pass
  
      return res_frame
  
imports: import pdb
  from typing import Optional
  import warnings
  import itertools
  import operator
  import copy
  import numpy
  import pandas
  from pandas.core.generic import NDFrame
  import dask
  import dask.dataframe
  import matplotlib.pyplot
  import seaborn
  from statsmodels.tsa.statespace.varmax import VARMAX
  from sklearn.model_selection import TimeSeriesSplit
  from ...utils import print_dynamic_rmse
  from ...models.ar_based.param_finder import find_lowest_pq
  from ..build_base import BuildBase
label_desc: Use image node_id 3 for calling the BuildVAR obj's underlying member method code with example usage: obj.predict(testdata, forecast_period, simple) and returns: res_frame