expander_e: Expand a Matrix

Description Usage Arguments Value Examples

View source: R/aux_funs.R

Description

Create a vector or matrix for expanding the dimension of another matrix by adding rows and columns filled with zeros. Multiply the result of expander_e with a matrix using the Kronecker product. See examples.

Usage

1
expander_e(r, c = 1)

Arguments

r

An integer scalar. It specifies the number of rows to create.

c

An integer scalar. It specifies the number of columns to create.

r and c must be equal or c must be a one.

Value

An (r x c) matrix. The very first element in the top left corner is a one, the rest are zeros.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
expander_e(3)
expander_e(4, 4)

expander_e(3, 3) %x% matrix(0.1, 4, 4)

## Not run: 

expander_e(4, 3)

## End(Not run)

nielsaka/zeitreihe documentation built on March 17, 2020, 8:38 p.m.