brainspace.null_models.moran.moran_randomization

brainspace.null_models.moran.moran_randomization(x, mem, n_rep=100, procedure='singleton', joint=False, random_state=None)[source]

Generate random samples from x based on Moran spectral randomization.

Parameters:
  • x (1D or 2D ndarray, shape = (n_vertices,) or (n_vertices, n_feat)) – Array of variables arranged in columns, where n_feat is the number of variables.
  • mem (2D ndarray, shape = (n_vertices, nv)) – Moran eigenvectors map, where nv is the number of eigenvectors arranged in columns.
  • n_rep (int, optional) – Number of random samples. Default is 100.
  • procedure ({'singleton, 'pair'}, optional) – Procedure to generate the random samples. Default is ‘singleton’.
  • joint (boolean, optional) – If True variables are randomized jointly. Otherwise, each variable is randomized separately. Default is False.
  • random_state (int or None, optional) – Random state. Default is None.
Returns:

output (ndarray, shape = (n_rep, n_vertices, n_feat)) – Random samples. If n_feat == 1, shape = (n_rep, n_vertices).

References

  • Wagner H.H. and Dray S. (2015). Generating spatially constrained null models for irregularly spaced data using Moran spectral randomization methods. Methods in Ecology and Evolution, 6(10):1169-78.