mx_guess_components: Initial Guess of Univariate Mixture Components

Description Usage Arguments Details Value See Also Examples

View source: R/mx_guess_components.R

Description

Heuristic method to guess number of components and their parameters (mean, standard deviation and weight) from observation data.

Usage

1
mx_guess_components(x, bw = 1, minpeak = 0, mincut = 0.9, ...)

Arguments

x

vector of (non-binned) observation data

bw

bandwidth of kernel density, cf. density

minpeak

minimum value of the total maximum which is regarded as peak

mincut

minimum relative height of a pit compared to the lower of the two neighbouring maxima at which these maxima are regarded as separate peaks (default value is derived from golden section)

...

further arguments passed to density

Details

The function guesses approximate start values of parameters that then need subsequent identification, e.g. with a maximum likelihood or EM (expectation maximization) method.

Value

data frame with mean (mean), standard deviation sd and mixing proportions L

See Also

peakwindow

Examples

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

mx_guess_components(x)

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