def distfitmc(sample, distr, nrepl=100, distkwds={}):
    arg = distkwds.pop('arg')
    nobs = len(sample)
    res = np.zeros(nrepl)
    for ii in range(nrepl):
        x = distr.rvs(arg, size=nobs, **distkwds)
        res[ii] = distr.fit_fr(x, frozen=[np.nan, 0.0, 1.0])
    return res
run Monte Carlo for estimation of distribution parameters
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/distributions/sppatch.py/distfitmc