set.seed(42)
n <- 100
p <- 4
X <- matrix(rnorm(n * p), n, p)
beta_true <- c(0.5, -1, 2, 5)
y <- rbinom(n, 1, 1 / (1 + exp(-X %*% beta_true)))
lambda <- 0.1
result <- CBPLogisticE(X, y, lambda)
print(result)
Run the code above in your browser using DataLab