gen_ortho: Simulate data for regression models in which the design...

View source: R/gen_ortho.R

gen_orthoR Documentation

Simulate data for regression models in which the design matrix X is orthonormal

Description

Simulate data for regression models in which the design matrix X is orthonormal

Usage

gen_ortho(
  n,
  p,
  p1 = floor(p/2),
  beta,
  family = c("gaussian", "binomial"),
  SNR = 1,
  signal = c("homogeneous", "heterogeneous")
)

Arguments

n

Sample size

p

Number of features

p1

Number of nonzero features

beta

Vector of regression coefficients in the generating model, or, if a scalar, the value of each nonzero regression coefficient.

family

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

SNR

Signal to noise ratio

signal

Should the beta coefficients be homogeneous (default) or heterogeneous

Examples

Data <- gen_ortho(5, 2)
Data$X
crossprod(Data$X)

pbreheny/hdrm documentation built on May 24, 2024, 9:30 p.m.