msaenet.sim.binomial: Generate Simulation Data for Benchmarking Sparse Regressions...

Description Usage Arguments Value Author(s) Examples

View source: R/msaenet-sim.R

Description

Generate simulation data for benchmarking sparse logistic regression models.

Usage

1
2
msaenet.sim.binomial(n = 300, p = 500, rho = 0.5, coef = rep(0.2,
  50), snr = 1, p.train = 0.7, seed = 1001)

Arguments

n

Number of observations.

p

Number of variables.

rho

Correlation base for generating correlated variables.

coef

Vector of non-zero coefficients.

snr

Signal-to-noise ratio (SNR).

p.train

Percentage of training set.

seed

Random seed for reproducibility.

Value

List of x.tr, x.te, y.tr, and y.te.

Author(s)

Nan Xiao <https://nanx.me>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dat <- msaenet.sim.binomial(
  n = 300, p = 500, rho = 0.6,
  coef = rep(1, 10), snr = 3, p.train = 0.7,
  seed = 1001
)

dim(dat$x.tr)
dim(dat$x.te)
table(dat$y.tr)
table(dat$y.te)

road2stat/msaenet documentation built on Dec. 17, 2018, 10:09 a.m.