Test for independence of two random vectors, learn and report the dependency structure. For more information, see Gorsky and Ma (2018) .
Package is available on CRAN, https://cran.r-project.org/web/packages/MultiFit/index.html and may be installed on Linux and Mac using devtools
:
install.packages('devtools')
library('devtools')
devtools::install_github('MultiFit', 'MaStatLab')
Generate two 2x2 random vectors, x and y. The second margin of both are dependent, the first not. Run R multiFit
to test for independence, run R multiSummary
to report the detected dependency structure. See vignette for further detials and examples.
set.seed(1)
n = 300
d1 = d2 = 2
x = matrix(0, nrow=n, ncol=d1)
y = matrix(0, nrow=n, ncol=d2)
x[,1] = rnorm(n)
x[,2] = runif(n)
y[,1] = rnorm(n)
y[,2] = sin(5*pi*x[,2]) + 1/5*rnorm(n)
fit = multiFit(x=x, y=y, verbose=TRUE)
w = multiSummary(x=x, y=y, fit=fit, alpha=0.0001)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.