coef.mix: Extract Mixture Model Coefficients

Description Usage Arguments Value See Also Examples

View source: R/coef.mix.R

Description

coef.mix is a function which extracts mixture model coefficients from objects returned by the model fitting function mix. It is called via the generic function coef.

Usage

1
2
## S3 method for class 'mix'
coef(object, natpar = FALSE, ...)

Arguments

object

an object of class "mix", usually, the results returned by the model fitting function mix.

natpar

a logical scalar specifying whether the natural parameters should be given.

...

other arguments.

Value

A data frame containing three variables, which are, in order, the proportions, means, and standard deviations, respectively. If natpar is TRUE, then the natural parameters of component distributions are also displayed.

See Also

mix for model fitting.

Examples

1
2
3
4
5
data(pike65) # load the grouped data `pike65'
data(pikepar) # load the initial values of parameters for the data `pike65'
fit <- mix(pike65, pikepar, "lnorm", mixconstr(consigma = "CCV"), emsteps = 3)
coef(fit)
coef(fit, natpar = TRUE)

Example output

          pi       mu    sigma
1 0.09967020 23.07345 2.372187
2 0.51889301 33.60686 3.455130
3 0.22676628 41.10281 4.225791
4 0.10710012 49.88249 5.128432
5 0.04757039 60.46694 6.216622
          pi       mu    sigma    shape     scale
1 0.09967020 23.07345 2.372187 3.133425 0.1025401
2 0.51889301 33.60686 3.455130 3.509473 0.1025401
3 0.22676628 41.10281 4.225791 3.710819 0.1025401
4 0.10710012 49.88249 5.128432 3.904413 0.1025401
5 0.04757039 60.46694 6.216622 4.096840 0.1025401

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

Related to coef.mix in mixdist...