segregation.inference.simulate_null

segregation.inference.simulate_null(iterations=500, sim_func=None, seg_class=None, n_jobs=-1, backend='loky', index_kwargs=None)[source]

Simulate a series of index values in parallel to serve as a null distribution.

Parameters:
iterationsint, required

Number of iterations to simulate (size of the distribution), by default 1000

sim_funcfunction, required

population randomization function from segregation.inference to serve as the null hypothesis.

seg_funcClass from segregation.singlegroup or segregation.singlegroup, required

fitted segregation class from which to generate a reference distribution

n_jobsint, optional

number of cpus to initialize for parallelization. If -1, use all available, by default -1

backendstr, optional

backend passed to joblib.Parallel, by default “loky”

index_kwargsdict, optional

additional keyword arguments used to fit the index, such as distance or network if estimating a spatial index; by default None

Returns:
list

pandas.Series of segregation indices for simulated data