r - Random cluster generation -
i want generate clusters of data points drawn multivariate gaussian distribution.
i want clusters have same co-variance matrix. using command genrandomclust clustergeneration package this.
but unfortunately above command generates clusters different covariance matrix. can 1 point me @ command or package can achieve objective?
how this? here drawing samples bi-variate normal random distribution.
library(mass) sigma <- matrix(c(10,3,3,2),2,2) # start fixed 2x2 covariance matrix, or generate randomly sigma datapoints <- mvrnorm(n = 1000, rep(0, 2), sigma) # draw 1000 mvn samples cov matrix sigma, mean c(0, 0) or use random mean vector var(datapoints) # notice covariance matrix datapoint generated different sigma datapoints <- mvrnorm(n = 1000, rep(0, 2), sigma, empirical = true) var(datapoints) # here covariance matrix datapoint generated equal sigma
Comments
Post a Comment