'Calculates the SE of lambda by nested resampling
Used to pivot the statistic.
Bootstrapping works better with estimating pivotal statistics
but slows down computation significantly.'

def _compute_se_lambda(self, Y, X):

    n = np.shape(Y)[0]
    lam = np.empty(shape=(self.nres,))
    for i in range(self.nres):
        ind = np.random.random_integers(0, (n - 1), size=(n, 1))
        Y1 = Y[(ind, 0)]
        X1 = X[ind, :]
        lam[i] = self._compute_lambda(Y1, X1)
    se_lambda = np.std(lam)
    return se_lambda
