View source: R/tools_generator.R
rmreg | R Documentation |
rmreg
returns an X matrix, a y vector and the cluster labels generated randomly with a Mixture of regression model.
rmreg( N, pi, A, sigma, X = cbind(rep(1, N), matrix(stats::rnorm(N * (ncol(A) - 1)), N, ncol(A) - 1)) )
N |
A numeric value the size of the graph to generate |
pi |
A numeric vector of length K with clusters proportions (must sum up to 1) |
A |
A numeric matrix of dim K x d with the regression coefficient |
sigma |
A numeric of length 1 with the target conditional variance |
X |
A matrix of covariate |
It takes the sample size, cluster proportions and regression parameters matrix and variance as input accordingly
A list with fields:
X: the covariate matrix
y: the target feature
K: number of generated clusters
N: sample size
cl: vector of clusters labels
pi: clusters proportions
A: regression coefficients used in the simulation
sigma: conditional variance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.