diff --git a/R-package/R/generate.data.R b/R-package/R/generate.data.R index 1d3eb83d..fcbde084 100644 --- a/R-package/R/generate.data.R +++ b/R-package/R/generate.data.R @@ -393,7 +393,7 @@ generate.data <- function(n, # set coef_0 as + abs(min(eta)) + 1 eta <- eta + abs(min(eta)) + 10 # set the shape parameter of gamma uniformly in [0.1, 100.1] - shape_para <- 100 * runif(n) + 0.1 + shape_para <- rep(100 * runif(1) + 0.1, n) y <- stats::rgamma(n, shape = shape_para, rate = shape_para * eta) } diff --git a/python/abess/datasets.py b/python/abess/datasets.py index f8ddb65d..4c08efa5 100644 --- a/python/abess/datasets.py +++ b/python/abess/datasets.py @@ -286,7 +286,7 @@ def __init__(self, n, p, k, family, rho=0, corr_type="const", sigma=1, eta = eta - np.abs(np.max(eta)) - 10 eta = -1 / eta # set the shape para of gamma uniformly in [0.1,100.1] - shape_para = 100 * np.random.uniform(0, 1, n) + 0.1 + shape_para = 100 * np.random.uniform(0, 1) + 0.1 y = np.random.gamma( shape=shape_para, scale=eta / shape_para,