WithinDeltaMat {resper} | R Documentation |
Given a sequence of numbers and a "window" delta, the function generates an adjacency matrix for the elements of the sequence and the relation |x-y| < delta, where x and y are two elements of the sequence.
WithinDeltaMat(seq, delta)
seq |
an ordered sequence of numbers |
delta |
a nonnegative number |
A matrix of Boolean values
(TRUE
for a pair of elements whose distance
is less than delta
).
Johannes Hüsing
## this returns a Toeplitz matrix WithinDeltaMat(1:10, 4) ## this generates a matrix from a Poisson sequence run <- cumsum(rgamma(100, 1)) WithinDeltaMat(run, 3)