.simulate {cornet} | R Documentation |
Data simulation
Description
Simulates data for unit tests
Usage
.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 |
prob |
effect proportion:
numeric between |
sd |
standard deviation: positive numeric |
exp |
exponent: positive numeric |
frac |
class proportion:
numeric between |
Details
For simulating correlated features (cor
>0
),
this function requires the R package MASS
(see mvrnorm
).
Value
Returns invisible list with elements y
and X
.
Examples
data <- cornet:::.simulate(n=10,p=20)
names(data)
[Package cornet version 0.0.9 Index]