Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

diag.block

Constructs a block diagonal matrix


Description

The function takes a list and constructs a block diagonal matrix with the elements of the list on the diagonal. If d is not a list then d will be repeated n times and written on the diagonal (a wrapper for kronecker())

Usage

diag.block(d, n)

Arguments

d

a list of matrices or vectors, or a matrix or vector

n

number of repetitions

Value

returns a matrix with the elements of the list or the repetitions of the supplied matrix or vector on the diagonal.

Author(s)

Wolfgang Lederer, wolfgang.lederer@gmail.com

See Also

Examples

a <- matrix(rep(1, 4), nrow = 2)
b <- matrix(rep(2, 6), nrow = 2)
e <- c(3, 3, 3, 3)
f <- t(e)
d <- list(a, b, e, f)
diag.block(d)
diag.block(a, 3)

simex

SIMEX- And MCSIMEX-Algorithm for Measurement Error Models

v1.8
GPL-3
Authors
Wolfgang Lederer [cre, aut], Heidi Seibold [aut], Helmut Küchenhoff [ctb], Chris Lawrence [ctb], Rasmus Froberg Brøndum [ctb]
Initial release
2019-07-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.