create_convex_hull_structure: create the convex hull associated with points

Description Usage Arguments Value Examples

View source: R/containment-and-band-creation.R

Description

I believe this will error unless one projects from the simplex to the lower dimensional space

Usage

1
2
3
4
5
create_convex_hull_structure(
  data_points,
  data_columns = NULL,
  .lower_simplex_project = TRUE
)

Arguments

data_points

points to create the convex hull structure from

data_columns

columns of data.frame that relate to the point's coordinates in euclidean space. This should be at least 3 columns (else it doesn't really make sense to use this function). The input should look like something like c(S,I,R) or c("S", "I", "R"). If the input is NULL this function will treat this like dplyr::everything().

.lower_simplex_project

boolean, if data points should be projected to a simplex and then to the lower dimensional simplex (for this package, this should always be done)

Value

a convex_hull_structure object, that is a data frame similar to data_points (but with out data_columns columns) and only points that define the convex hull. This object also has an normals attribute which contains a matrix with the first p columns defining "A" and the last defining "b", such that -Ax >= b defines the convex hull.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(dplyr)
# this will look like a 2d data frame (but this is becuase pomp_df info is
# on the 3d simplex)
convex_hull_cb <- EpiCompare::pomp_df %>%
  filter(.id <= 10) %>%
  arrange(time) %>% # just to be safe
  select(-time, -H, -cases) %>%
  group_by(.id) %>%
  grab_top_depth_filaments(conf_level = .9) %>%
  create_convex_hull_structure() #data_columns = c(S,I,R)

skgallagher/EpiCompare documentation built on Sept. 14, 2021, 5:45 a.m.