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:
- iterations
int
,required
Number of iterations to simulate (size of the distribution), by default 1000
- sim_func
function
,required
population randomization function from segregation.inference to serve as the null hypothesis.
- seg_func
Class
from
segregation.singlegroup
orsegregation.singlegroup
,required
fitted segregation class from which to generate a reference distribution
- n_jobs
int
,optional
number of cpus to initialize for parallelization. If -1, use all available, by default -1
- backend
str
,optional
backend passed to joblib.Parallel, by default “loky”
- index_kwargs
dict
,optional
additional keyword arguments used to fit the index, such as distance or network if estimating a spatial index; by default None
- iterations
- Returns:
list
pandas.Series of segregation indices for simulated data