@classmethod
def from_lavaan(cls, string=None, filename=None):
    """
        Initializes a `SEM` instance using lavaan syntax.

        Parameters
        ----------
        string: str (default: None)
            A `lavaan` style multiline set of regression equation representing the model.
            Refer http://lavaan.ugent.be/tutorial/syntax1.html for details.

        filename: str (default: None)
            The filename of the file containing the model in lavaan syntax.

        Examples
        --------
        """
    if filename:
        with open(filename, 'r') as f:
            lavaan_str = f.readlines()
    elif string:
        lavaan_str = string.split('\n')
    else:
        raise ValueError('Either `filename` or `string` need to be specified')
    return cls(syntax='lavaan', lavaan_str=lavaan_str)
