View source: R/hypervolume_expectation.R
expectation_convex | R Documentation |
Generates expectation hypervolume corresponding to a convex hull (polytope) that minimally encloses the data.
expectation_convex(input, point.density = NULL, num.samples = NULL,
num.points.on.hull = NULL, check.memory = TRUE,
verbose = TRUE, use.random = FALSE, method =
"hitandrun", chunksize = 1000)
input |
A m x n matrix or data frame, where m is the number of observations and n is the dimensionality. |
point.density |
The point density of the output expectation. If |
num.samples |
The number of points in the output expectation. If |
num.points.on.hull |
Number of points of the input used to calculate the convex hull. Larger values are more accurate but may lead to slower runtimes. If |
check.memory |
If |
verbose |
If |
use.random |
If |
method |
One of |
chunksize |
Number of random points to process per internal step. Larger values may have better performance on machines with large amounts of free memory. Changing this parameter does not change the output of the function; only how this output is internally assembled. |
The rejection sampling algorithm generates random points within a hyperbox enclosing the points, then sequentially tests whether each is in or out of the convex polytope based on a dot product test. It becomes exponentially inefficient in high dimensionalities. The hit-and-run sampling algorithm generates a Markov chain of samples that eventually converges to the true distribution of points within the convex polytope. It performs better in high dimensionalities but may not converge quickly. It will also be slow if the number of simplices on the convex polytope is large.
Both algorithms may become impracticably slow in >= 6 or 7 dimensions.
A Hypervolume-class
object corresponding to the expectation hypervolume.
## Not run:
data(penguins,package='palmerpenguins')
penguins_no_na = as.data.frame(na.omit(penguins))
penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie",
c("bill_length_mm","bill_depth_mm","flipper_length_mm")]
e_convex <- expectation_convex(penguins_adelie, check.memory=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.