data_generation {cossonet}R Documentation

The function data_generation generates an example dataset for applying the cossonet function.

Description

The function data_generation generates an example dataset for applying the cossonet function.

Usage

data_generation(
  n,
  p,
  rho,
  SNR,
  response = c("continuous", "binary", "count", "survival")
)

Arguments

n

observation size.

p

dimension.

rho

a positive integer indicating the correlation strength for the first four informative variables.

SNR

signal-to-noise ratio.

response

the type of the response variable.

Value

a list of explanatory variables, response variables, and true functions.

Examples

# Generate example data
set.seed(20250101)
tr = data_generation(n = 200, p = 20, SNR = 9, response = "continuous")
tr_x = tr$x
tr_y = tr$y

te = data_generation(n = 1000, p = 20, SNR = 9, response = "continuous")
te_x = te$x
te_y = te$y


[Package cossonet version 1.0 Index]