generateb: Generates a vector of population regression coefficients

Description Usage Arguments Details Value Examples

Description

Generates a vector of population regression coefficients

Usage

1
generateb(p, method = "randN", b1 = NULL, s = 10, spar = 10, ...)

Arguments

p

the number of coefficients

method

one of eight named methods of generation, see Details below

b1

for method='expdecay', see Details below

s

for method='sparse', see Details below

spar

the l2 norm of the resulting coefficient vector, see Details below

...

optional arguments to random number generators, see Details below

Details

This function generates a vector of coefficients using one of eight methods.

expdecay

The result is b1^(1:p)

lindecay

p:1/p

sparse

Produces s coefficents drawn independently from the Laplace distribution, followed by p-s zeros

randU

uniform random coefficents, takes arguments in ...

randN

Random Normal coefficients, takes arguments in ...

constNorm

all coefficients are equal and the vector has l2 norm spar

constLinDecay

Same as lindecay except that the resulting vector has norm spar

constant

produces a p-vector of 1's

Value

a vector of length p

Examples

1
2
3
4
5
generateb(10, 'constNorm')
generateb(10, 'randN', mean=1, sd=.1)
generateb(10, 'expdecay', b1=.9)
generateb(10, 'expdecay', b1=1) # same as 'constant'
generateb(10, 'constant')

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