'In-sample prediction and out-of-sample forecasting
Parameters
start : int, str, or datetime, optional
Zero-indexed observation number at which to start forecasting,
i.e., the first forecast is start. Can also be a date string to
parse or a datetime type. Default is the the zeroth observation.
end : int, str, or datetime, optional
Zero-indexed observation number at which to end forecasting, i.e.,
the last forecast is end. Can also be a date string to
parse or a datetime type. However, if the dates index does not
have a fixed frequency, end must be an integer index if you
want out of sample prediction. Default is the last observation in
the sample.
dynamic : boolean, int, str, or datetime, optional
Integer offset relative to `start` at which to begin dynamic
prediction. Can also be an absolute date string to parse or a
datetime type (these are not interpreted as offsets).
Prior to this observation, true endogenous values will be used for
prediction; starting with this observation and continuing through
the end of prediction, forecasted endogenous values will be used
instead.
**kwargs
Additional arguments may required for forecasting beyond the end
of the sample. See `FilterResults.predict` for more details.
Returns
forecast : array
Array of out of in-sample predictions and / or out-of-sample
forecasts. An (npredict x k_endog) array.'

def get_prediction(self, start=None, end=None, dynamic=False, index=None, **kwargs):

    if (start is None):
        start = self.model._index[0]
    (start, end, out_of_sample, prediction_index) = self.model._get_prediction_index(start, end, index)
    if isinstance(dynamic, str):
        (dynamic, _, _) = self.model._get_index_loc(dynamic)
    prediction_results = self.filter_results.predict(start, ((end + out_of_sample) + 1), dynamic, **kwargs)
    return PredictionResultsWrapper(PredictionResults(self, prediction_results, row_labels=prediction_index))
