mixparam: Construct Starting Values for Parameters

Description Usage Arguments Value See Also Examples

View source: R/mixparam.R

Description

Construct starting values for parameters of a mixture model.

Usage

1

Arguments

mu

a vector of means of component distributions, which should be in ascending order.

sigma

a vector of standard deviations of component distributions, which are corresponding to the means. sigmas must be in ascending order when means are equal.

pi

the corresponding mixing proportions of components. If NULL, the proportions will be taken as 1/k, where k is the number of elements of mu.

Value

A data frame containing three variables, which are, in order, the proportions, means, and standard deviations.

See Also

mixgroup for grouping data, mixconstr for constructing constraints.

Examples

1
2
mixparam(mu = c(20, 30, 40), sigma = c(2, 3, 4))
mixparam(c(20, 30, 40), c(3), c(0.15, 0.78, 0.07))

Example output

         pi mu sigma
1 0.3333333 20     2
2 0.3333333 30     3
3 0.3333333 40     4
    pi mu sigma
1 0.15 20     3
2 0.78 30     3
3 0.07 40     3

mixdist documentation built on May 2, 2019, 3:34 p.m.

Related to mixparam in mixdist...