def fit(data, distribution='<STR_LIT>'):
params = getattr(_st, distribution).fit(data)<EOL>return FitResults(params, _st.kstest(data, distribution, params), distribution)<EOL>
Calculate the parameters of a fit of a distribution to a data set

    Parameters:
        data: array of data points to be fitted

    Options:
        distribution (str): type of distribution to fit. Default 'norm'.

    Returns:
        FitResults object with fitted parameters, errors and distribution type

    Note:
        Uses Kolmogorov-Smirnov test to estimate distance and p-value.