Skip to contents

Create a standalone shift mapper that can be used as part of a bru_mapper_pipe. If mapper is non-null, the bru_mapper_shift() constructor returns bru_mapper_pipe(list(mapper = mapper, shift = bru_mapper_shift()))

Usage

bru_mapper_shift(mapper = NULL)

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

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

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

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

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

Arguments

mapper

A mapper S3 object, inheriting from bru_mapper.

...

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(bru_mapper_shift): input NULL values are interpreted as no shift.

Examples

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