Learn R Programming

hypervolume (version 3.1.4)

expectation_ball: Hypersphere expectation

Description

Generates expectation hypervolume corresponding to a hypersphere that minimally encloses the data.

Usage

expectation_ball(input, point.density = NULL, num.samples = NULL,
                 use.random = FALSE)

Value

A Hypervolume-class object corresponding to the expectation.

Arguments

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 NULL, defaults to v / num.points where d is the dimensionality of the input and v is the volume of the hypersphere.

num.samples

The number of points in the output expectation. If NULL, defaults to 10^(3+sqrt(ncol(d))) where d is the dimensionality of the input. num.points has priority over point.density; both cannot be specified.

use.random

If TRUE and the input is of class Hypervolume, sets boundaries based on the @RandomPoints slot; otherwise uses @Data.

Examples

Run this code
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_ball <- expectation_ball(penguins_adelie)

Run the code above in your browser using DataLab