genDataFromExamples: Data generation

Description Usage Arguments Value Examples

View source: R/genDataFromExamples.R

Description

Auxiliary function for generating simple artificial data sets with normally distributed coefficients and regressors. Note that we only report this function for reproducibility of the simulations from the PhD thesis of the author.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
genDataFromExamples(
  p,
  n,
  s = 1,
  xmean = 0,
  betamean = 0,
  betasd = 1,
  snr = 2,
  rho = 0
)

Arguments

p

Number of variables (columns).

n

Number of observations (rows).

s

Sparsity. Real number between 0 and 1. s=1 (default) leads to a coefficient vector without zero entries.

xmean

Mean of each of the normally distributed columns. Default is 0.

betamean

Mean of each of the normally distributed coefficients. Default is 0.

betasd

Standard deviation of the normally distributed coefficients. Default is 1.

snr

Signal to noise ratio. Real number greater than zero. Default is 2.

rho

Parameter for a Toeplitz covariance structure of the regressors. Real number between -1 and 1. Default is 0 which corresponds to uncorrelated columns.

Value

D

Data matrix (X,Y).

vars

A list of the relevant variables.

Examples

1

gfboost documentation built on Jan. 7, 2022, 5:06 p.m.