distMat: Make a matrix with coefficients distributed as dist

Description Usage Arguments Details Value Examples

View source: R/expandFunctions.R

Description

Generate a pXq matrix with coefficients drawn from the univariate distribution dist with options distOpt.

Usage

1
distMat(p, q, dist = rnorm, distOpt = NULL)

Arguments

p

Number of rows

q

Number of columns

dist

distribution of coefficients to draw from; default is rnorm.

distOpt

Named list of additional parameters for dist. Always omit the first parameter,n, of the distribution sampling function. Defaults may be omitted if desired (see examples).

Details

The user may provide their own distribution function, but note that the number of values to return, n, must be the first argument, just as with the built-in distributions. The first argument does not have to be named.

Value

A pXq matrix with coefficients distributed as dist with parameters defined in '...'

Examples

1
2
3
4
5
X <- distMat(10,2)
X <- distMat(10,2,distOpt=list(mean=1,sd=2))
X <- distMat(5,3,rnorm,list(mean=1,sd=2))
X <- distMat(5,3,rnorm,list(sd=2))
X <- distMat(50,3,rt,list(df=3))

expandFunctions documentation built on May 2, 2019, 9:15 a.m.