do.hilbert: Generate the Hilbert Index from a Cut Reference Matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/do.hilbert.R

Description

Generate the Hilbert Index corresponding to the sub-spaces defined by the coordinates generated via do.cut

Usage

1
do.hilbert(mat, horder)

Arguments

mat

the cut reference matrix

horder

the Hilbert order, i.e. the number of bins in each dimension

Details

For each line in mat, the function will compute the corresponding Hilbert index. Each index corresponds to a specific sub-cube of the original high-dimensional space, and consecutive hilbert index correspond to adjacent sub-cubes

Value

a vector of indices, one for each line in mat

Author(s)

Marilisa Neri

Yann Abraham

John Skilling (for the original C function)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# generate a random 3D matrix
mat <- matrix(rnorm(300),ncol=3)
dimnames(mat)[[2]] <- LETTERS[1:3]
# generate 2 bins with a minimum bin size of 5
cuts <- make.cut(mat,n=3,count.lim=5)
show.cut(cuts)
# Generate the cuts
cut.mat <- do.cut(mat,cuts,type='fixed')
head(cut.mat)
# generate the Hilber index
hc <- do.hilbert(cut.mat,2)
plot(table(hc),type='l')

hilbertSimilarity documentation built on Nov. 12, 2019, 1:06 a.m.