random.pm {gaston} | R Documentation |
Random square definite positive matrix
Description
Generate a random definite positive matrix with specified dimension
Usage
random.pm(n, values)
Arguments
n |
Dimension of matrix |
values |
(Optional) A numeric vector of dimension n : the eigenvalues of the matrix |
Details
If values
isn't given, it is chosen (deterministically)
so that the eigenvalues of the resulting matrix are
similar to eigenvalues observed on Genetic Relationship Matrices.
The random matrix is generated as U diag( values ) U'
with U
a random orthogonal matrix.
Value
A named list with members:
K |
A |
eigen |
The eigen decomposition of |
See Also
Examples
# generate a random positive matrix
set.seed(1)
R <- random.pm(500)
str(R)
[Package gaston version 1.6 Index]