# mgc.sample: MGC Sample In neurodata/mgc-r: Multiscale Graph Correlation

## Description

The main function that computes the MGC measure between two datasets: It first computes all local correlations, then use the maximal statistic among all local correlations based on thresholding.

## Usage

 `1` ```mgc.sample(A, B, option = "mgc") ```

## Arguments

 `A` is interpreted as: a `[n x n]` distance matrixA is a square matrix with zeros on diagonal for `n` samples. a `[n x d]` data matrixA is a data matrix with `n` samples in `d` dimensions. `B` is interpreted as: a `[n x n]` distance matrixB is a square matrix with zeros on diagonal for `n` samples. a `[n x d]` data matrixB is a data matrix with `n` samples in `d` dimensions. `option` is a string that specifies which global correlation to build up-on. Defaults to `'mgc'`. `'mgc'`use the MGC global correlation. `'dcor'`use the dcor global correlation. `'mantel'`use the mantel global correlation. `'rank'`use the rank global correlation.

## Value

A list containing the following:

 `statMGC` is the sample MGC statistic within `[-1,1]` `localCorr` consists of all local correlations by double matrix index `optimalScale` the estimated optimal scale in matrix single index.

C. Shen

## Examples

 ```1 2 3 4 5``` ```library(mgc) n=200; d=2 data <- mgc.sims.linear(n, d) lcor <- mgc.sample(data\$X, data\$Y) ```

neurodata/mgc-r documentation built on Feb. 3, 2019, 12:43 a.m.