def bootstrap2(value, distr, args=(), nobs=200, nrep=100):
 count = 0
 for irep in range(nrep):
  rvs = distr.rvs(args, **{'size': nobs})
  params = distr.fit_vec(rvs)
  cdfvals = np.sort(distr.cdf(rvs, params))
  stat = asquare(cdfvals, axis=0)
  count += (stat >= value)
 return ((count * 1.0) / nrep)

def bootstrap2 ( value , distr , args = ( ) , nobs = 200 , nrep = 100 ) : count = 0 for irep in range ( nrep ) : rvs = distr . rvs ( args , ** { 'size' : nobs } ) params = distr . fit_vec ( rvs ) cdfvals = np . sort ( distr . cdf ( rvs , params ) ) stat = asquare ( cdfvals , axis = 0 ) count += ( stat >= value ) return ( ( count * 1.0 ) / nrep )
monte carlo p-values for gof currently hardcoded for a^2 only non vectorized .