createData: Generates data as in the paper

Description Usage Arguments Value Examples

Description

Generates data as in the paper

Usage

1
createData(ntrain, ntest, p, covType, rho, bmethod, SNR, noisesd, ...)

Arguments

ntrain

number of training samples

ntest

number of testing samples

p

number of predictors

covType

for use with generateCov

rho

for use with generateCov

bmethod

for use with generateb

SNR

if not na, sets the standard deviation of the noise to √{b'Cov b} / SNR

noisesd

the standard deviation of the noise if SNR=NA

...

optional arguments passed to generateb

Value

A list with components Xtrain, Ytrain, Xtest, Ytest, bstar, and sig giving respectively the training data, testing data, population regression coefficients, and noise standard deviation. The matrix Xtest is the same as the training data adjusted to the correct size (either by truncating or recycling) so that predictions are at the same design points. Note that this function is simply a wrapper of the various generate* functions for ease of simulation. If more flexibility is desired, use those directly or similar.

Examples

1
createData(2500, 2, 250, 'corrUniform', .8, 'constant', NA, 2500-250-1)

dajmcdon/cplr documentation built on May 14, 2019, 3:29 p.m.