'Replicate variance parameters to match a group\'s design.
Parameters
vcomp : array-like
The variance parameters for the variance components.
group : string
The group label
Returns an expanded version of vcomp, in which each variance
parameter is copied as many times as there are independent
realizations of the variance component in the given group.'

def _expand_vcomp(self, vcomp, group):

    if (len(vcomp) == 0):
        return np.empty(0)
    vc_var = []
    for (j, k) in enumerate(self._vc_names):
        if (group in self.exog_vc[k]):
            vc_var.append((vcomp[j] * np.ones(self.exog_vc[k][group].shape[1])))
    if (len(vc_var) > 0):
        return np.concatenate(vc_var)
    else:
        return np.empty(0)
