Simulates data for unit tests

.simulate(n, p, cor = 0, prob = 0.1, sd = 1, exp = 1, frac = 1)

Arguments

n

sample size: positive integer

p

covariate space: positive integer

cor

correlation coefficient : numeric between \(0\) and \(1\)

prob

effect proportion: numeric between \(0\) and \(1\)

sd

standard deviation: positive numeric

exp

exponent: positive numeric

frac

class proportion: numeric between \(0\) and \(1\)

Value

Returns invisible list with elements y and X.

Details

For simulating correlated features (cor\(>0\)), this function requires the R package MASS (see mvrnorm).

Examples

data <- cornet:::.simulate(n=10,p=20)
names(data)
#> [1] "y"      "X"      "cutoff"