def predict(self, h, h_train=40):
        """ Run out-of-sample predicitons for Aggregate algorithm
        (This only works for non-exogenous variable models currently)
        
        Parameters
        ----------
        h : int
            How many out-of-sample steps to run the aggregating algorithm on 

        h_train : int
            How many in-sample steps to warm-up the ensemble weights on

        Returns
        ----------
        - pd.DataFrame of Aggregate out-of-sample predictions
        """

        predictions, index = self._model_predict(h)
        normalized_weights = self.run(h=h_train)[0][-1, :]
        ensemble_prediction = np.zeros(h)
        
        for t in range(h):
            ensemble_prediction[t] = np.dot(normalized_weights, predictions.values[t,:])

        result = pd.DataFrame(ensemble_prediction)
        result.index = index

        return result
def predict ( self , h , h_train = 40 ) : predictions , index = self . _model_predict ( h ) normalized_weights = self . run ( h = h_train ) [ 0 ] [ - 1 , : ] ensemble_prediction = np . zeros ( h ) for t in range ( h ) : ensemble_prediction [ t ] = np . dot ( normalized_weights , predictions . values [ t , : ] ) result = pd . DataFrame ( ensemble_prediction ) result . index = index return result
Run out-of-sample predicitons for Aggregate algorithm
        (This only works for non-exogenous variable models currently)
        
        Parameters
        ----------
        h : int
            How many out-of-sample steps to run the aggregating algorithm on 

        h_train : int
            How many in-sample steps to warm-up the ensemble weights on

        Returns
        ----------
        - pd.DataFrame of Aggregate out-of-sample predictions