gaussian_mixture_model: Fit 2-component Gaussian mixture model

Description Usage Arguments Value Author(s) References Examples

Description

Fit a 2-component Gaussian mixture model.

Usage

1
2
3
gaussian_mixture_model(data, formula, B = 200,
  se.method = c("bootstrap", "wlbs"), mu = NA, mufixed = FALSE,
  maxit = 200, ...)

Arguments

data

a data frame or tibble

formula

a formula model formula for the relationship

B

a positive integer giving the number of bootstrap samples used to obtain the estimates of the variance associated with the parameter estimates.

se.method

The method to compute the standard errors. Defaults to "bootstrap" but "wlbs" (weighted likelihood bootstrap) is probably a more robust bet.

mu

A starting value for the mu component. Defaults to NA (which means that the starting value is calculated from the average value of the outcomes)

mufixed

A boolean stating whether the mu component should be fixed at the given value. Defaults to FALSE.

maxit

The maximum number of iterations used for computing the estimates from the gaussian mixture model. Defaults to 200.

...

Additional arguments passed on to the fitting process.

Value

Returns a list with the following elements: ...

Author(s)

Claus Ekstrom ekstrom@sund.ku.dk and Christian Pipper pipper@sund.ku.dk

References

Unpublished manuscript by authors and Newton and Raftery (1994): "Approximate Bayesian Inference with the Weighted Likelihood Boostrap". JRSS-

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
p <- 0.7  #
N <- 100
x <- rnorm(N)
x2 <- rnorm(N)
y <- rnorm(N, mean=x)
y[1:(N*p)] <- rnorm(N*p, mean=0, sd=.25)

DF <- data.frame(x, x2, y)

gaussian_mixture_model(DF, y ~ x + x2)

ekstroem/mommix documentation built on May 14, 2019, 9:36 p.m.