mgrwc: Gaussian mixture of regression models with contamination

Description Usage Arguments Details Value Author(s) Examples

Description

Fast computation of simple regression slopes for each predictor represented by a column in a matrix

Usage

1
2
mgrwc(y, X, weight, maxit = 400L, tol = 1e-07, alpha = 0.3,
  mu = NA_real_, mufixed = FALSE)

Arguments

y

A vector of outcomes.

X

A design matrix of regressor variables. Must have the same number of rows as the length of y.

weight

A vector of weights for each observation that are used in the estimation.

maxit

the maximum number of iterations to use for the EM algorithm

tol

the tolerance used for determining convergence

alpha

the starting probability for an observation originating from the contamination distribution. Must be strictly between 0 and 1

mu

the starting value for the mean of the contamination distribution. If set to NA (the default) then the mean of the y vector is used.

mufixed

Should the value ...

Details

Missing values (NA, Inf, NaN) are completely disregarded and pairwise complete cases are used for the analysis.

Value

A list with the variables: N, K, coefficients, mu, sigma1, sigma2, alpha, iterationsused, and groupprob which contains information on the nuber of observations, mixture components, coefficients for ...

Author(s)

Claus Ekstrom <ekstrom@sund.ku.dk>

Examples

1
2
3
x <- rnorm(1000)
y <- rnorm(1000, mean=c(x[1:700], rep(0, 300)), sd=rep(c(1,2), times=c(700,300)))
mgrwc(y, cbind(rep(1, 1000), x), weight=rep(1, 1000))

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