Learn R Programming

fake (version 1.4.0)

BlockMatrix: Block matrix

Description

Generates a symmetric block matrix of size (sum(pk) x sum(pk)). The sizes of the submatrices is defined based on pk. For each submatrix, all entries are equal to the submatrix (block) index.

Usage

BlockMatrix(pk)

Value

A symmetric block matrix.

Arguments

pk

vector encoding the grouping structure.

See Also

Other block matrix functions: BlockDiagonal(), BlockStructure()

Examples

Run this code
# Example 1
BlockMatrix(pk = c(2, 3))

# Example 2
BlockMatrix(pk = c(2, 3, 2))

Run the code above in your browser using DataLab