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

View source: R/is.inCH.R

is.inCHR Documentation

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


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.

shrink_into_CH() returns the coefficient by which rows of p can be scaled towards or away from point m in order for all of them to be in the convex hull of M or on its boundary.


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

  m = NULL,
  verbose = FALSE,
  solver = c("glpk", "lpsolve")



A d-dimensional vector or a matrix with d columns


An n by d matrix. Each row of M is a d-dimensional vector.


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


A character string selecting which solver to use; by default, tries Rglpk's but falls back to lpSolveAPI's.


is.inCH() was originally written for the "stepping" algorithm of Hummel et al (2012). See Krivitsky, Kuvelkar, and Hunter (2022) for detailed discussion of algorithms used in is.inCH() and shrink_into_CH().


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


is.inCH() has been deprecated in favour of shrink_into_CH(), which returns the optimal step length instead of a yes-or-no test. In general, shrink_into_CH(...)>=1 is equivalent to 'is.inCH(...).



  • 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.

  • Krivitsky, P. N., Kuvelkar, A. R., and Hunter, D. R. (2022). Likelihood-based Inference for Exponential-Family Random Graph Models via Linear Programming. arXiv preprint arXiv:2202.03572.

ergm documentation built on June 2, 2022, 1:07 a.m.