distMat: Make a matrix with coefficients distributed as dist
Description
Generate a pXq matrix with coefficients drawn
from the univariate distribution dist with
options distOpt.
Usage
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).
Value
A pXq matrix with coefficients distributed
as dist with parameters defined in `...`
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.
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))