Description Usage Arguments Value Author(s) Examples
Fit a mixture model using moments
1 2 | moment_mixture_model(data, formula, weights = c("equal", "square"),
maxiter = 5)
|
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 |
Returns a list with the following elements:
* coefficients The estimates of the parameters for * alpha * mu * covariance * call
Claus Ekstrom ekstrom@sund.ku.dk and Christian Pipper pipper@sund.ku.dk
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.