rmreg {greed}R Documentation

Generate data from a mixture of regression model

Description

rmreg returns an X matrix, a y vector and the cluster labels generated randomly with a Mixture of regression model.

Usage

rmreg(
  N,
  pi,
  A,
  sigma,
  X = cbind(rep(1, N), matrix(stats::rnorm(N * (ncol(A) - 1)), N, ncol(A) - 1))
)

Arguments

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

Details

It takes the sample size, cluster proportions and regression parameters matrix and variance as input accordingly

Value

A list with fields:


[Package greed version 0.6.1 Index]