Computes the moran eigenvectors required for Moran spectral randomization (source code).
Y_rand = moran_randomization(Y,MEM,n_rep,varargin);
- Y: An n-by-m data matrix to randomize where n is number of datapoints and m are different modalities.
- MEM: Moran eigenvectors as returned by
compute_mem_matlab
. - n_rep: Number of pertubations
- varargin: See name-value pairs below.
- Y_rand: Randomized data.
Implementation of Moran spectral randomization as presented by (Wagner and Dray, 2015). This function uses the eigenvectors computed by compute_mem_matlab
to generate null model data with similar spatial autocorrelation. The implemented procedures are 'singleton' and 'pair'. Singleton matches the input data's autocorrelation more closely at the cost of fewer possible randomizations (max: 2n). In most use-cases this allows for ample randomizations. In cases where the maximum number of randomizations becomes restrictive, we recommend using the pair procedure instead.
- procedure: Randomization procedure; either 'singleton' or 'pair'.
- joint: If true, randomizes different modalities identically.
- random_state: Initilaization of the random state. Accepts any argument accepted by rng() or nan for no initialization.