fitmix.plot: Plot empirical density and components and total density for...

Description Usage Arguments Value Author(s) Examples

View source: R/fitmix.R

Description

Draws a nice plot.

Usage

1
fitmix.plot(x, p, mu, sigma)

Arguments

x

Real vector of data.

p

Real vector of mixture proportions.

mu

Real vector of mixture component means.

sigma

Real vector of mixture component standard deviations.

Value

Returns an invisible null.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
xx <- fitmix.simulate(100, c(0.49, 0.42, 0.09), c(0, 1, 2), c(.3, .3, .3))

## additive model, common variance, Hardy--Weinberg
fit.a <- fitmix(xx, 3, maxit = 10, restarts = 3,
                sigma.common = TRUE, p.binomial = TRUE, mu.additive = TRUE)
## general (unrestricted) fit
fit.g <- fitmix(xx, 3, maxit = 10, restarts = 3)

oldpar <- par(mfrow = c(1, 2))
fitmix.plot(xx, fit.a$p, fit.a$mu, fit.a$sigma)
fitmix.plot(xx, fit.g$p, fit.g$mu, fit.g$sigma)
par(oldpar)

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.