Learn R Programming

multinomineq (version 0.2.6)

inside: Check Whether Points are Inside a Convex Polytope

Description

Determines whether a point x is inside a convex poltyope by checking whether (1) all inequalities A*x <= b are satisfied or (2) the point x is in the convex hull of the vertices in V.

Usage

inside(x, A, b, V)

Arguments

x

a vector of length equal to the number of columns of A or V (i.e., a single point in D-dimensional space) or matrix of points/vertices (one per row).

A

a matrix with one row for each linear inequality constraint and one column for each of the free parameters. The parameter space is defined as all probabilities x that fulfill the order constraints A*x <= b.

b

a vector of the same length as the number of rows of A.

V

a matrix of vertices (one per row) that define the polytope of admissible parameters as the convex hull over these points (if provided, A and b are ignored). Similar as for A, columns of V omit the last value for each multinomial condition (e.g., a1,a2,a3,b1,b2 becomes a1,a2,b1). Note that this method is comparatively slow since it solves linear-programming problems to test whether a point is inside a polytope (Fukuda, 2004) or to run the Gibbs sampler.

See Also

Ab_to_V and V_to_Ab to change between A/b and V representation.

Examples

Run this code
# linear order constraints:  x1

Run the code above in your browser using DataLab