cornerSort: Candidate combinations as corners

Description Usage Arguments Details Value Examples

View source: R/cornerSort.R

Description

Given a set of data points, return possible combinations of data points as corners. These combinations are selected by ranking the sum of margin-of-errors.

Usage

1
cornerSort(X, K, nComb)

Arguments

X

Data in a matrix. Each column is a data point.

K

The number of corner points.

nComb

The number of returned combinations of data points as corners. All combinations will be returned if the number of all combinations is less than nComb.

Details

This function is to detect K corner points from M data points by conducting an exhaustive combinatorial search (with total C_M^K combinations), based on a convex-hull-to-data fitting criterion: sum of margin-of-errors. nComb combinations are returned for further selection based on reconstruction errors of all data points in original space.

The function is implemented in Java with R-to-Java interface provided by rJava package. It relies on NonNegativeLeastSquares class in Parallel Java Library (https://www.cs.rit.edu/~ark/pj.shtml).

Value

A list containing the following components:

idx

A matrix to show the indexes of data points in combinations to construct a convex hull. Each column is one combination.

error

A vector of margin-of-error sums for each combination.

Examples

1
2
3
4
data <- matrix(c(0.1,0.2,1.0,0.0,0.0,0.5,0.3,
                 0.1,0.7,0.0,1.0,0.0,0.5,0.3,
                 0.8,0.1,0.0,0.0,1.0,0.0,0.4), nrow =3, byrow = TRUE)
topconv <- cornerSort(data, 3, 10)

Lululuella/debCAM documentation built on May 14, 2021, 2:45 p.m.