data_gen: Normal regression data generator

Description Usage Arguments Value Author(s) Examples

View source: R/data_gen.R

Description

True beta values are generated from p*r independent draws from N(0, 1/p) distribution. X are n independent draws from p multivariate normal N(0, SigmaX). Y is then generated using X and true beta values with an iid error term that follows r multivariate normal distribution N(0, Sigma).

Usage

1
2
3
data_gen(n, p, r = 1, sparsity = 0.5, Sigma = c("tridiag", "dense",
  "denseQR", "compound"), s = NULL, SigmaX = c("tridiag", "dense",
  "denseQR", "compound"), sx = NULL, ...)

Arguments

n

desired sample size

p

desired dimension

r

number of responses

sparsity

desired sparsity for beta

Sigma

covariance matrix structure used to generate Y | X

s

option to specify diagonal elements in Sigma

SigmaX

covariance matrix structure used to generate data X

sx

option to specify diagonal elements in SigmaX

...

additional arguments to pass to data generating functions

Value

Y, X, betas, Sigma, SigmaX

Author(s)

Matt Galloway gall0441@umn.edu

Examples

1
2
# generate 100 observations with predictor dimension equal to 10 and response dimension equal to 5
data = data_gen(n = 100, p = 10, r = 5)

SCPME documentation built on May 2, 2019, 3:42 a.m.