Generate_data: Generate_data

Description Usage Arguments Value

View source: R/Generate_data.R

Description

This function generates data (X,y) with specified correlation and noise standard deviation.

Usage

1
2
Generate_data(truth.beta, p, n, truth.sigma, rho, correlation = c("block", "all"),
NumOfBlock)

Arguments

truth.beta

A vector of active beta's (s x 1, with s being the number of active coordinates).

p

The number of covariates.

n

The number of observations.

truth.sigma

Noise standard deviation.

rho

Correlation Coefficient.

correlation

Correlation structure. Correlation = "block" means predictors are grouped into equi-size blocks where each block contains one active predictor, and the within-block correlation coefficient is rho; predictors in different blocks are mutually independent. Correlation = "all" means all predictors are equi-correlated with coefficient rho.

NumOfBlock

Number of blocks, used only when correlation = 'block'.

Value

A list, including vector 'y' (n x 1), matrix 'X' (n x p), vector 'beta' (p x 1).


BBSSL documentation built on April 27, 2021, 9:06 a.m.

Related to Generate_data in BBSSL...