Generate random data from mixture Gaussian distribution.
Usage
mydata(n, d, mu = 0.8, portion = 1/2)
Arguments
n
The number of observations (sample size).
d
The number of variables (dimension).
mu
In the Gaussian mixture model, the first Gaussian is generated with zero mean and identity covariance matrix.
The second Gaussian is generated with mean a d-dimensional vector with all mu and identity covariance matrix.
portion
The prior probability for the first Gaussian component.
Value
Return the data matrix with n rows and d + 1 columns. Each row represents a sample generated from the mixture Gaussian distribution. The first d columns are features and the last column is the class label of the corresponding sample.