Skip to contents

Implementations must return a bm_taylor object The linearisation information includes offset, jacobian, and state0. The state information indicates for which state the offset was evaluated, with NULL meaning all-zero. The linearised mapper output is defined as

effect(input, state) =
  offset(input, state0) + jacobian(input, state0) %*% (state - state0)

The default method calls ibm_eval() and ibm_jacobian() to generate the needed information.

Usage

ibm_linear(mapper, input, state = NULL, ...)

# Default S3 method
ibm_linear(mapper, input, state, ...)

# S3 method for class 'bm_multi'
ibm_linear(mapper, input, state, inla_f = FALSE, ...)

# S3 method for class 'bm_collect'
ibm_linear(mapper, input, state, inla_f = FALSE, ...)

# S3 method for class 'bm_repeat'
ibm_linear(mapper, input, state, ...)

# S3 method for class 'bm_sum'
ibm_linear(mapper, input, state, ...)

# S3 method for class 'bru_comp'
ibm_linear(mapper, input, state = NULL, ...)

Arguments

mapper

A mapper S3 object, inheriting from bru_mapper.

input

Data input for the mapper.

state

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

...

Arguments passed on to other methods

inla_f

logical; when TRUE for ibm_n() and ibm_values(), the result must be compatible with the INLA::f(...) and corresponding INLA::inla.stack(...) constructions. For ibm_{eval,jacobian,linear}, the input interpretation may be different. Implementations do not normally need to do anything different, except for mappers of the type needed for hidden multicomponent models such as "bym2", which can be handled by bm_collect.

Value

A bm_taylor object. The state0 information in the affine mapper indicates for which state the offset was evaluated; The affine mapper output is defined as

effect(input, state) =
  offset(input, state0) + jacobian(input, state0) %*% (state - state0)

Methods (by class)

See also

Other mapper methods: bru_mapper_generics, ibm_eval(), ibm_eval2(), ibm_inla_subset(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_names(), ibm_simplify(), ibm_values()

Other specific bm_multi method implementations: bm_multi(), ibm_eval(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_names(), ibm_values()

Other specific bm_collect method implementations: bm_collect(), ibm_eval(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_names(), ibm_values()

Other specific bm_repeat method implementations: bm_repeat(), ibm_eval(), ibm_invalid_output(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_values()

Other specific bm_sum method implementations: bm_sum(), ibm_eval(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_names(), ibm_values()