'return the index array for lagged values
Warning: if k is larger then the number of observations for an
individual, then no values for that individual are returned.
TODO: for the unbalanced case, I should get the same truncation for
the array with lag=0. From the return of lag_idx we wouldn\'t know
which individual is missing.
TODO: do I want the full equivalent of lagmat in tsa?
maxlag or lag or lags.
not tested yet'

def lag_indices(self, lag):

    lag_idx = (np.asarray(self.groupidx)[:, 1] - lag)
    mask_ok = (lag <= lag_idx)
    return lag_idx[mask_ok]
