Skip to content

Commit

Permalink
fix: define only one shape-para in Gamma model
Browse files Browse the repository at this point in the history
  • Loading branch information
bbayukari committed Sep 3, 2023
1 parent e2ffe0d commit d039462
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R-package/R/generate.data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion python/abess/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d039462

Please sign in to comment.