R: Determine whether a vector is in the closure of the convex...

is.inCH {ergm} | R Documentation

## 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`. If `p` is a matrix, each row is tested individually, and `TRUE` is returned if all rows are in the convex hull.

### Usage

    is.inCH(p, M, verbose = FALSE, ...)

### Arguments

`p` | A d-dimensional vector or a matrix with d columns
`M` | An n by d matrix. Each row of `M` is a d-dimensional vector.
`verbose` | A logical or an integer to control the amount of progress and diagnostic information to be printed. `FALSE`/`0` produces minimal output, wit higher values producing more detail. Note that very high values (5+) may significantly slow down processing.
`...` | arguments passed directly to linear program solver

### Details

The d-vector `p` is in the convex hull of the d-vectors forming the rows of `M` if and only if there exists no separating hyperplane between `p` and the rows of `M`. This condition may be reworded as follows:

Letting q=(1 p')' and L = (1 M), if the minimum value of z'q for all z such that z'L ≥ 0 equals zero (the minimum must be at most zero since z=0 gives zero), then there is no separating hyperplane and so `p` is contained in the convex hull of the rows of `M`. So the question of interest becomes a constrained optimization problem.

Lastly, in the event of such a hyperplane existing, one can make the objective function arbitrarily low by multiplying z by a large positive constant. To prevent it from running away, we constrain the elements of z to be between -1 and +1.

Solving this problem relies on the package lpSolveAPI to solve a linear program.

This function is used in the "stepping" algorithm of Hummel et al (2012).

### Value

Logical, telling whether `p` is (or all rows of `p` are) in the closed convex hull of the points in `M`.

### References

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

- Hummel, R. M., Hunter, D. R., and Handcock, M. S. (2012), Improving Simulation-Based Algorithms for Fitting ERGMs, Journal of Computational and Graphical Statistics, 21: 920-939.

[Package ergm version 4.1.2 Index]