Learn R Programming

xyz (version 0.1)

xyz_search: 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.

Examples

Run this code
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]
#run the interaction search
result<-xyz_search(X,Y,L=10,N=10,binary=TRUE,negative=TRUE)
#print the result
print(result)

Run the code above in your browser using DataLab