def build_init_comps(self, prev_comps, split_comp_ix, prev_med_and_spans, memb_probs):
    "\n        Given a list of converged components from a N component fit, generate\n        a list of N+1 components with which to initialise an EM run.\n\n        This is done by taking the target component, `prev_comps[comp_ix]`,\n        replacing it in the list of comps, by splitting it into two components\n        with a lower and higher age,\n\n        Parameters\n        ----------\n        prev_comps : [N] list of Component objects\n            List of components from the N component fit\n        split_comp_ix : int\n            The index of component which is to be split into two\n        prev_med_and_spans : [ncomps,npars,3] np.array\n            The median and spans of\n\n        Return\n        ------\n        init_comps: [N+1] list of Component objects\n\n        Side effects\n        ------------\n        Updates self.fit_pars['init_comps'] with a [N+1] list of Component\n        objects\n        "
    target_comp = prev_comps[split_comp_ix]
    assert isinstance(target_comp, self.Component)
    if (self.fit_pars['split_group'] == 'age'):
        if (self.fit_pars['optimisation_method'] == 'emcee'):
            split_comps = target_comp.split_group_age(lo_age=prev_med_and_spans[(split_comp_ix, (- 1), 1)], hi_age=prev_med_and_spans[(split_comp_ix, (- 1), 2)])
        elif (self.fit_pars['optimisation_method'] == 'Nelder-Mead'):
            age = target_comp.get_age()
            split_comps = target_comp.split_group_age(lo_age=(0.8 * age), hi_age=(1.2 * age))
    elif (self.fit_pars['split_group'] == 'spatial'):
        split_comps = target_comp.split_group_spatial(self.data_dict, memb_probs[:, split_comp_ix])
    init_comps = list(prev_comps)
    init_comps.pop(split_comp_ix)
    init_comps.insert(split_comp_ix, split_comps[1])
    init_comps.insert(split_comp_ix, split_comps[0])
    return init_comps
Given a list of converged components from a N component fit, generate
a list of N+1 components with which to initialise an EM run.

This is done by taking the target component, `prev_comps[comp_ix]`,
replacing it in the list of comps, by splitting it into two components
with a lower and higher age,

Parameters
----------
prev_comps : [N] list of Component objects
    List of components from the N component fit
split_comp_ix : int
    The index of component which is to be split into two
prev_med_and_spans : [ncomps,npars,3] np.array
    The median and spans of

Return
------
init_comps: [N+1] list of Component objects

Side effects
------------
Updates self.fit_pars['init_comps'] with a [N+1] list of Component
objects
def build_init_comps(self, prev_comps, split_comp_ix, prev_med_and_spans, memb_probs):
    "\n        Given a list of converged components from a N component fit, generate\n        a list of N+1 components with which to initialise an EM run.\n\n        This is done by taking the target component, `prev_comps[comp_ix]`,\n        replacing it in the list of comps, by splitting it into two components\n        with a lower and higher age,\n\n        Parameters\n        ----------\n        prev_comps : [N] list of Component objects\n            List of components from the N component fit\n        split_comp_ix : int\n            The index of component which is to be split into two\n        prev_med_and_spans : [ncomps,npars,3] np.array\n            The median and spans of\n\n        Return\n        ------\n        init_comps: [N+1] list of Component objects\n\n        Side effects\n        ------------\n        Updates self.fit_pars['init_comps'] with a [N+1] list of Component\n        objects\n        "
    target_comp = prev_comps[split_comp_ix]
    assert isinstance(target_comp, self.Component)
    if (self.fit_pars['split_group'] == 'age'):
        if (self.fit_pars['optimisation_method'] == 'emcee'):
            split_comps = target_comp.split_group_age(lo_age=prev_med_and_spans[(split_comp_ix, (- 1), 1)], hi_age=prev_med_and_spans[(split_comp_ix, (- 1), 2)])
        elif (self.fit_pars['optimisation_method'] == 'Nelder-Mead'):
            age = target_comp.get_age()
            split_comps = target_comp.split_group_age(lo_age=(0.8 * age), hi_age=(1.2 * age))
    elif (self.fit_pars['split_group'] == 'spatial'):
        split_comps = target_comp.split_group_spatial(self.data_dict, memb_probs[:, split_comp_ix])
    init_comps = list(prev_comps)
    init_comps.pop(split_comp_ix)
    init_comps.insert(split_comp_ix, split_comps[1])
    init_comps.insert(split_comp_ix, split_comps[0])
    return init_comps