Skip to contents

Checks whether theta belongs to space.

A count vector belongs when its entries are non-negative whole numbers summing to n_trials; tol is unused.

Usage

contains(space, theta, tol = 1e-08)

Arguments

space

A space.

theta

A point of the space.

tol

Tolerance.

Value

TRUE or FALSE.

Examples

s <- simplex_region(vertices = diag(3))
contains(s, c(1 / 3, 1 / 3, 1 / 3))
#> [1] TRUE
contains(s, c(2, -1, 0))
#> [1] FALSE

# A count space is a space too, and answers the same question.
contains(count_space(n_trials = 4L, k = 3L), c(2L, 1L, 1L))
#> [1] TRUE
contains(count_space(n_trials = 4L, k = 3L), c(2L, 1L, 0L))
#> [1] FALSE