'Called on the first call to update
`ilabels` is a list of n_i x n_i matrices containing integer
labels that correspond to specific correlation parameters.
Two elements of ilabels[i] with the same label share identical
variance components.
`designx` is a matrix, with each row containing dummy
variables indicating which variance components are associated
with the corresponding element of QY.'

def initialize(self, model):

    super(Nested, self).initialize(model)
    if (self.model.weights is not None):
        warnings.warn('weights    not    implemented    for    nested    cov_struct,    using    unweighted    covariance    estimate', NotImplementedWarning)
    id_matrix = np.asarray(self.model.dep_data)
    if (id_matrix.ndim == 1):
        id_matrix = id_matrix[:, None]
    self.id_matrix = id_matrix
    endog = self.model.endog_li
    (designx, ilabels) = ([], [])
    n_nest = self.id_matrix.shape[1]
    for i in range(self.model.num_group):
        ngrp = len(endog[i])
        glab = self.model.group_labels[i]
        rix = self.model.group_indices[glab]
        (ix1, ix2) = np.tril_indices(ngrp, (-1))
        ncm = (self.id_matrix[rix[ix1], :] == self.id_matrix[rix[ix2], :]).sum(1)
        ilabel = np.zeros((ngrp, ngrp), dtype=np.int32)
        ilabel[[ix1, ix2]] = (ncm + 1)
        ilabel[[ix2, ix1]] = (ncm + 1)
        ilabels.append(ilabel)
        dsx = np.zeros((len(ix1), (n_nest + 1)), dtype=np.float64)
        dsx[:, 0] = 1
        for k in np.unique(ncm):
            ii = np.flatnonzero((ncm == k))
            dsx[ii, 1:(k + 1)] = 1
        designx.append(dsx)
    self.designx = np.concatenate(designx, axis=0)
    self.ilabels = ilabels
    svd = np.linalg.svd(self.designx, 0)
    self.designx_u = svd[0]
    self.designx_s = svd[1]
    self.designx_v = svd[2].T
