Skip to contents

Create a matrix mapper, for a given number of columns

Usage

bm_matrix(labels)

bru_mapper_matrix(...)

Arguments

labels

Column labels for matrix mappings; Can be factor, character, or a single integer specifying the number of columns for integer column indexing.

...

Arguments passed on to bm_matrix()

Examples

m <- bm_matrix(labels = c("a", "b"))
ibm_values(m)
#> [1] a b
#> Levels: a b
ibm_eval2(m, input = matrix(1:6, 3, 2), state = 2:3)
#> $offset
#> [1] 14 19 24
#> 
#> $jacobian
#> 3 x 2 Matrix of class "dgeMatrix"
#>      a b
#> [1,] 1 4
#> [2,] 2 5
#> [3,] 3 6
#> 

m <- bm_matrix(labels = 2L)
ibm_values(m)
#> [1] 1 2
ibm_eval2(m, input = matrix(1:6, 3, 2), state = 2:3)
#> $offset
#> [1] 14 19 24
#> 
#> $jacobian
#> 3 x 2 Matrix of class "dgeMatrix"
#>      1 2
#> [1,] 1 4
#> [2,] 2 5
#> [3,] 3 6
#>