makeBlockDiag {PCGII} | R Documentation |
Generate block-diagonal matrix of size p by p
Description
A utility function generates block-diagonal matrix of size p by p with blocks B1, B2, ..., Bk. Each block matrix is of size blocksize by blocksize. The off-diagonal elements in block matrix are generated from uniform (min.beta, max.beta). The diagonal elements in block matrix are generated from uniform (1, 1.25).
Usage
makeBlockDiag(blocksize = 4, p = 20, min.beta = 0.3, max.beta = 0.9)
Arguments
blocksize |
A positive integer, the dimension of the block matrix. Note, 'blocksize' has to be a factor of 'p'. |
p |
A positive integer, the size of the block-diagonal matrix. |
min.beta |
A positive number, lower limits of the uniform distribution. |
max.beta |
A positive number, upper limits of the uniform distribution. |
Value
A block-diagonal matrix of size 'p' by 'p'.
Examples
mat = makeBlockDiag(blocksize=4, p=20)
[Package PCGII version 1.1.2 Index]