generate_y_logistic | R Documentation |
Generate (binary) logistic response data given the observed design matrices.
generate_y_logistic(X, betas = 0, intercept = 0, return_support = FALSE, ...)
X |
Design data matrix of observed variables. |
betas |
Coefficient vector for observed design matrix. If a scalar is provided, the coefficient vector is constant. If |
intercept |
Scalar intercept term. |
return_support |
Logical specifying whether or not to return a vector of
the support column names. If |
... |
Not used. |
If return_support = TRUE
, returns a list of two:
A response vector of length nrow(X)
.
A vector of feature indices indicating all features used in the true support of the DGP.
If return_support = FALSE
, returns only the response vector y
.
X <- generate_X_gaussian(.n = 100, .p = 2) # generate the response from: log(p / (1 - p)) = 3*x_1 - x_2 # where p = P(y = 1 | x) y <- generate_y_logistic(X = X, betas = c(3, -1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.