Learn R Programming

ergm (version 3.1.3)

is.inCH: Determine whether a vector is in the closure of the convex hull of some sample of vectors

Description

is.inCH returns TRUE if and only if p is contained in the convex hull of the points given as the rows of M.

Usage

is.inCH(p, M)

Arguments

p
A $d$-dimensional vector
M
An $r$ by $d$ matrix. Each row of M is a $d$-dimensional vector.

Value

  • Logical, telling whether p is in the closed convex hull of the points in M.

Details

This function depends on the package Rglpk to solve a constrained linear optimization problem in order to determine an answer. The question of whether p is in a closed convex set S may be formulated as the question of whether there exists a separating hyperplane between p and S, which may in turn be formulated as the question of whether the maximum possible value of a linear function, subject to constraints, has a strictly positive solution. Note that the answer given could be incorrect simply due to rounding error if the true maximum is close to zero. For this reason, the package rcdd, which produces exact rational-number solutions to linear programs, could be used instead of Rglpk. However, this approach would require more computing and would therefore be slower.

References

http://www.cs.mcgill.ca/~fukuda/soft/polyfaq/node22.html