Description Usage Arguments Value Examples
This function creates a dataset with $n$ rows, $p$ predictors and $k$ classes, for simulation of a mixture or logisitc regression models.
1 2 | generate_mixture(n, p, k, beta = matrix(runif(k * p, -2, 2), nrow = k),
ak = generate_probability_vector(k))
|
n |
Number of observations |
p |
Number of predictors for each individual logistic regression model |
k |
Number of classes |
beta |
A $k$ by $p$ matrix with the true regression coefficients for each mixture component |
ak |
A vector of length k summing to 1 for the mixture probabilties |
A list containing slots data
and params
containing the
simulated data and the true parameters respectively
1 2 3 | generate_mixture(100, 3, 2)
generate_mixture(100, 2, 1)
generate_mixture(10^4, 4,6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.