genDataABN: Simulate data according to Causal/Correlated/Noise paradigm

View source: R/genDataABN.R

genDataABNR Documentation

Simulate data according to Causal/Correlated/Noise paradigm

Description

Simulate data according to Causal/Correlated/Noise paradigm

Usage

genDataABN(
  n = 100,
  p = 60,
  a = 6,
  b = 2,
  rho = 0.5,
  family = c("gaussian", "binomial"),
  signal = c("homogeneous", "heterogeneous"),
  noise = c("exchangeable", "autoregressive"),
  rho.noise = 0,
  beta,
  SNR = 1
)

Arguments

n

Sample size

p

Number of features

a

Number of causal ('A') variables

b

Number of correlated ('B') variables per causal ('A') variable

rho

Correlation between 'A' and 'B' variables

family

Generate y according to linear "gaussian" or logistic "binomial" model

signal

Should the groups be heterogeneous (in beta) or homogeneous?

noise

Correlation structure between features ('exchangeable' | 'autoregressive')

rho.noise

Correlation parameter for noise variables

beta

Vector of regression coefficients in the generating model. Should be either a scalar, in which case it represents the value of each nonzero regression coefficient, or a vector, in which case it should be of length a

SNR

Signal to noise ratio

Examples

Data <- genDataABN(n=100, p=20, a=2, b=3)
dim(Data$X)
length(Data$y)
with(Data, data.frame(beta, varType))

genDataABN(100, 10, 2, 1)$beta
genDataABN(100, 10, 2, 1, rho=0.9)$beta
genDataABN(100, 10, 2, 1, rho=0.9, rho.noise=0.9)$beta
genDataABN(100, 10, 2, 1, SNR=3)$beta
genDataABN(100, 10, 2, 1, SNR=3, signal='het')$beta
genDataABN(100, 10, 2, 1, beta=3)$beta
genDataABN(100, 10, 2, 1, beta=10:1)$beta

genDataABN(10, 20, 2, 3, family='binomial')$y



pbreheny/hdrm documentation built on Jan. 17, 2024, 8:53 p.m.