xyz_search {xyz}R Documentation

Interaction search

Description

Interaction search

Usage

xyz_search(X, Y, L = 10, N = 100, binary = TRUE, negative = TRUE)

Arguments

X

A matrix.

Y

A vector.

L

An integer indicating how many projection steps are performed.

N

A integer, controlling the number of pairs that will be returned in the end.

binary

A logical indicating if X is binary or continuous.

negative

A logical indicating if also negative interactions should be searched for.

Value

N strongest interactions between X and Y after L projections.

References

G. Thanei, N. Meinshausen and R. Shah (2016). The xyz algorithm for fast interaction search in high-dimensional data. <https://arxiv.org/pdf/1610.05108v1.pdf>

Examples

n<-300
p<-1000
#construct a binary matrix
X<-matrix(sample(c(-1,1),replace=TRUE,n*p),n,p)
#set an interaction of the pair (1,2)
Y<-X[,1]*X[,2]+rnorm(n)
#run the interaction search
result<-xyz_search(X,Y,L=10,N=10,binary=TRUE,negative=TRUE)
#print the result
print(result)

[Package xyz version 0.2 Index]