Learn R Programming

gaston (version 1.4.9)

random.pm: Random square definite positive matrix

Description

Generate a random definite positive matrix with specified dimension

Usage

random.pm(n, values = n*diff(seq(0,1,length=n+1)**0.75))

Arguments

n
Dimension of matrix
values
Eigenvalues of matrix

Value

A named list with members:

Details

The default for values is chosen so that the eigenvalues of the resulting matrix are roughly similar to the eigenvalues typically observed on Genetic Relationship Matrices.

See Also

lmm.simu, eigen

Examples

Run this code
# generate a random positive matrix 
set.seed(1)
R <- random.pm(503)
str(R)

Run the code above in your browser using DataLab