Skip to contents

Create a standalone scaling mapper that can be used as part of a bm_pipe. If mapper is non-null, the bm_scale() constructor returns bm_pipe(list(mapper = mapper, scale = bm_scale()))

Usage

bm_scale(mapper = NULL)

bru_mapper_scale(...)

# S3 method for class 'bm_scale'
ibm_n(mapper, ..., state = NULL, n_state = NULL)

# S3 method for class 'bm_scale'
ibm_n_output(mapper, input, state = NULL, ..., n_state = NULL)

# S3 method for class 'bm_scale'
ibm_values(mapper, ..., state = NULL, n_state = NULL)

# S3 method for class 'bm_scale'
ibm_jacobian(mapper, input, state = NULL, ..., sub_lin = NULL)

# S3 method for class 'bm_scale'
ibm_eval(mapper, input, state = NULL, ..., sub_lin = NULL)

Arguments

mapper

For bm_scale(), an optional bru_mapper to be scaled. For ibm_* methods, a bm_scale mapper object.

...

Arguments passed on to other methods

state

A vector of latent state values for the mapping, of length ibm_n(mapper, inla_f = FALSE)

n_state

integer giving the length of the state vector for mappers that have state dependent output size.

input

Data input for the mapper.

sub_lin

Internal, optional pre-computed sub-mapper information

Methods (by generic)

  • ibm_jacobian(bm_scale): input NULL values are interpreted as no scaling.

Examples

m <- bm_scale()
ibm_eval2(m, c(1, 2, 1, 2), 1:4)
#> $offset
#> [1] 1 4 3 8
#> 
#> $jacobian
#> 4 x 4 diagonal matrix of class "ddiMatrix"
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    .    .    .
#> [2,]    .    2    .    .
#> [3,]    .    .    1    .
#> [4,]    .    .    .    2
#>