zd_main_components: Extract Main Components from Zone Diameter (ZD) Mixture...

Description Usage Arguments Details Examples

View source: R/zd_main_components.R

Description

Extract np-1 main components and an additional first potentially exponentially distributed component from a data frame of distribution parameters with columns mean, sd, L.

Usage

1
zd_main_components(p, np = 3, near_zero = 3)

Arguments

p

data frame of distribution parameters (mean, sd, L) returned by mx_guess_components

np

number of desired components

near_zero

heuristic upper boundary of the zone diameter interval that is considered as close to zero. Components with mean value below will be considered as resistant subpopulation.

Details

The algorithm is specifically intended to zone diameter (ZD) distributions where the leftmost (resistant) subpopulation is considered exponentially distributed, while the others (intermediate, wild-type) are considered approximately normal.

Examples

1
2
3
4
5
6
set.seed(123)
x <- c(rexp(20, rate=1), rnorm(30, 10, 1), rnorm(10,15,.2), rnorm(50, 20, 2))
hist(x, breaks=20)
p <- mx_guess_components(x)

(ret <- zd_main_components(p, np=3))

tpetzoldt/antibioticR documentation built on Sept. 25, 2021, 1:17 p.m.