regmixEM {mixtools} | R Documentation |
EM Algorithm for Mixtures of Regressions
Description
Returns EM algorithm output for mixtures of multiple regressions with arbitrarily many components.
Usage
regmixEM(y, x, lambda = NULL, beta = NULL, sigma = NULL, k = 2,
addintercept = TRUE, arbmean = TRUE, arbvar = TRUE,
epsilon = 1e-08, maxit = 10000, verb = FALSE)
Arguments
y |
An n-vector of response values. |
x |
An nxp matrix of predictors. See |
lambda |
Initial value of mixing proportions. Entries should sum to
1. This determines number of components. If NULL, then |
beta |
Initial value of |
sigma |
A vector of standard deviations. If NULL, then 1/ |
k |
Number of components. Ignored unless all of |
addintercept |
If TRUE, a column of ones is appended to the x matrix before the value of p is calculated. |
arbmean |
If TRUE, each mixture component is assumed to have a different set of regression coefficients
(i.e., the |
arbvar |
If TRUE, each mixture component is assumed to have a different |
epsilon |
The convergence criterion. |
maxit |
The maximum number of iterations. |
verb |
If TRUE, then various updates are printed during each iteration of the algorithm. |
Value
regmixEM
returns a list of class mixEM
with items:
x |
The set of predictors (which includes a column of 1's if |
y |
The response values. |
lambda |
The final mixing proportions. |
beta |
The final regression coefficients. |
sigma |
The final standard deviations. If |
scale |
If |
loglik |
The final log-likelihood. |
posterior |
An nxk matrix of posterior probabilities for observations. |
all.loglik |
A vector of each iteration's log-likelihood. |
restarts |
The number of times the algorithm restarted due to unacceptable choice of initial values. |
ft |
A character vector giving the name of the function. |
References
de Veaux, R. D. (1989), Mixtures of Linear Regressions, Computational Statistics and Data Analysis 8, 227-245.
Hurn, M., Justel, A. and Robert, C. P. (2003) Estimating Mixtures of Regressions, Journal of Computational and Graphical Statistics 12(1), 55–79.
McLachlan, G. J. and Peel, D. (2000) Finite Mixture Models, John Wiley and Sons, Inc.
See Also
Examples
## EM output for NOdata.
data(NOdata)
attach(NOdata)
set.seed(100)
em.out <- regmixEM(Equivalence, NO, verb = TRUE, epsilon = 1e-04)
em.out[3:6]