'Compute lag order selections based on each of the available information
criteria
Parameters
maxlags : int
if None, defaults to 12 * (nobs/100.)**(1./4)
trend : str {"nc", "c", "ct", "ctt"}
* "nc" - no deterministic terms
* "c" - constant term
* "ct" - constant and linear term
* "ctt" - constant, linear, and quadratic term
Returns
selections : LagOrderResults'

def select_order(self, maxlags=None, trend='c'):

    if (maxlags is None):
        maxlags = int(round((12 * ((len(self.endog) / 100.0) ** (1 / 4.0)))))
    ics = defaultdict(list)
    p_min = (0 if ((self.exog is not None) or (trend != 'nc')) else 1)
    for p in range(p_min, (maxlags + 1)):
        result = self._estimate_var(p, offset=(maxlags - p), trend=trend)
        for (k, v) in iteritems(result.info_criteria):
            ics[k].append(v)
    selected_orders = dict(((k, (mat(v).argmin() + p_min)) for (k, v) in iteritems(ics)))
    return LagOrderResults(ics, selected_orders, vecm=False)
