# Generate a 10x10 specific shape sparse covariance matrix
shape_matrix <- matrix(rnorm(100), 10, 10)
shape_matrix <- shape_matrix %*% t(shape_matrix) # Making it positive definite
result <- generate_specific_shape_sparse_cov_matrix(n = 10, p = 5, M = shape_matrix)
Y <- result$Y
cov_Y <- result$cov_Y
Run the code above in your browser using DataLab