Python function that will rerun a function until its output convergences. The output must be numerical values. It can been an int, float, list, or array. Requires numpy.
This method runs the function in chunks (N=sample_size
). It calculates the mean and standard deviation of the total set of samples after each chunk. If the mean and standard deviation of the total set is relatively close (see rtol
) the last iteration, the sampling is assumed to have converged.