bdiag: Build a block diagonal matrix

Description Usage Arguments Value Author(s) Examples

Description

The function builds a block diagonal matrix.

Usage

1

Arguments

...

individual matrices, or a list of matrices.

Value

A matrix obtained by combining the arguments.

Author(s)

Giovanni Petris GPetris@uark.edu

Examples

1
2
bdiag(matrix(1:4,2,2),diag(3))
bdiag(matrix(1:6,3,2),matrix(11:16,2,3))

Example output

     [,1] [,2] [,3] [,4] [,5]
[1,]    1    3    0    0    0
[2,]    2    4    0    0    0
[3,]    0    0    1    0    0
[4,]    0    0    0    1    0
[5,]    0    0    0    0    1
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    4    0    0    0
[2,]    2    5    0    0    0
[3,]    3    6    0    0    0
[4,]    0    0   11   13   15
[5,]    0    0   12   14   16

dlm documentation built on May 2, 2019, 4:58 p.m.