# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Gaussian mixture of regression models with contamination
#'
#' Fast computation of simple regression slopes for each predictor represented by a column in a matrix
#'
#' Missing values (NA, Inf, NaN) are completely disregarded and pairwise complete cases are used for the analysis.
#'
#' @param y A vector of outcomes.
#' @param X A design matrix of regressor variables. Must have the same number of rows as the length of y.
#' @param weight A vector of weights for each observation that are used in the estimation.
#' @param maxit the maximum number of iterations to use for the EM algorithm
#' @param tol the tolerance used for determining convergence
#' @param alpha the starting probability for an observation originating from the contamination distribution. Must be strictly between 0 and 1
#' @param 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.
#' @param mufixed Should the value ...
#' @return 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 Claus Ekstrom <ekstrom@@sund.ku.dk>
#' @examples
#' 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))
#'
#' @export
mgrwc <- function(y, X, weight, maxit = 400L, tol = 1e-07, alpha = 0.3, mu = NA_real_, mufixed = FALSE) {
.Call(`_mommix_mgrwc`, y, X, weight, maxit, tol, alpha, mu, mufixed)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.