Description Usage Arguments Details Value Examples

View source: R/hypervolume_inclusion_test.R

Determines if a set of points are within a hypervolume.

1 2 | ```
hypervolume_inclusion_test(hv, points, reduction_factor = 1,
verbose = T, distance_factor = 1)
``` |

`hv` |
n-dimensional hypervolume to compare against |

`points` |
Candidate points. A m x n matrix or dataframe, where m is the number of candidate points and n is the number of dimensions. |

`reduction_factor` |
A number in (0,1] that represents the fraction of random points sampled from the hypervolume for the stochastic inclusion test. Larger values are more accurate but computationally slower. |

`verbose` |
Logical value; print diagnostic output if true. |

`distance_factor` |
Numeric value; multiplicative factor applied to the critical distance for all inclusion tests (see below). Recommended to not change this parameter. |

Tests if a point is in a hypervolume by determining if it is within a characteristic distance of at least one point from a uniformly random sample of the hypervolume. Because this algorithm is based on distances calculated between the distributions of random points, the critical distance (point density ^ (-1/n)) can be scaled by a user-specified factor to provide more or less liberal estimates (`distance_factor`

greater than or less than 1).

A m x 1 logical vector indicating whether each candidate point is in the hypervolume.

1 2 3 4 5 6 | ```
# construct a hypervolume of points in the unit square [0,1] x [0,1]
data = data.frame(x=runif(100,min=0,max=1), y=runif(100,min=0,max=1))
hv = hypervolume(data, reps=1000, bandwidth=0.1)
# test if (0.5,0.5) and (-1,1) are in - should return TRUE FALSE
hypervolume_inclusion_test(hv, points=data.frame(x=c(0.5,-1),y=c(0.5,-1)))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.