moment_mixture_model: Mixture modeling using moments

Description Usage Arguments Value Author(s) Examples

Description

Fit a mixture model using moments

Usage

1
2
moment_mixture_model(data, formula, weights = c("equal", "square"),
  maxiter = 5)

Arguments

data

a data frame or tibble

formula

a formula model formula for the relationship

weights

a string that defines the weights used for the estimation using weighted regression. Possibilities are "equal" (the default) for unweighted regression estimation and "square" for squared linear predictor estimation.

maxiter

integer

Value

Returns a list with the following elements:

* coefficients The estimates of the parameters for * alpha * mu * covariance * call

Author(s)

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

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)

moment_mixture_model(DF, y ~ x + x2)

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