@classmethod
def from_msm(cls, msm, n_macrostates):
    """Create and fit lumped model from pre-existing MSM.

        Parameters
        ----------
        msm : MarkovStateModel
            The input microstate msm to use.
        n_macrostates : int
            The number of macrostates

        Returns
        -------
        lumper : cls
            The fit PCCA(+) object.
        """
    params = msm.get_params()
    lumper = cls(n_macrostates, **params)
    lumper.transmat_ = msm.transmat_
    lumper.populations_ = msm.populations_
    lumper.mapping_ = msm.mapping_
    lumper.countsmat_ = msm.countsmat_
    lumper.n_states_ = msm.n_states_
    lumper._do_lumping()
    return lumper
