WithinDeltaMat {resper}R Documentation

Generating an adjacency matrix for |x-y| < delta

Description

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.

Usage

WithinDeltaMat(seq, delta)

Arguments

seq an ordered sequence of numbers
delta a nonnegative number

Value

A matrix of Boolean values (TRUE for a pair of elements whose distance is less than delta).

Author(s)

Johannes Hüsing

Examples

##  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)

[Package resper version 0.3.2 Index]