True beta values are generated from p*r independent draws from N(0, 1/p) distribution. X are n independent draws from p multivariate normal N(0, SigmaX). Y is then generated using X and true beta values with an iid error term that follows r multivariate normal distribution N(0, Sigma).
# NOT RUN {# generate 100 observations with predictor dimension equal to 10 and response dimension equal to 5data = data_gen(n = 100, p = 10, r = 5)
# }