moran_randomization

Synopsis

Computes the moran eigenvectors required for Moran spectral randomization (source code).

Usage

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.
  • n_rep: Number of pertubations
  • varargin: See name-value pairs below.
  • Y_rand: Randomized data.

Description

Implementation of Moran spectral randomization as presented by (Wagner and Dray, 2015). This function uses the eigenvectors computed by compute_mem 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.

Name-Value Pairs

  • 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.