Compute a mapper linearisation
Source:R/mappers.R, R/mapper_collect.R, R/mapper_expr.R, and 3 more
ibm_as_taylor.RdImplementations 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
The default method calls ibm_eval2() to generate
the needed information.
Usage
ibm_as_taylor(mapper, input, state = NULL, ...)
# Default S3 method
ibm_as_taylor(mapper, input, state, ...)
# S3 method for class 'bm_multi'
ibm_as_taylor(mapper, input, state, inla_f = FALSE, ...)
# S3 method for class 'bm_collect'
ibm_as_taylor(mapper, input, state, inla_f = FALSE, ...)
# S3 method for class 'bm_expr'
ibm_as_taylor(
mapper,
input,
state,
...,
derived = NULL,
jacobians = NULL,
data = data,
inla_f = FALSE
)
# S3 method for class 'bru_obs'
ibm_as_taylor(mapper, input, state, ..., multi = FALSE, comp_mappers)
# S3 method for class 'bru_obs_list'
ibm_as_taylor(
mapper,
input,
state,
...,
multi = FALSE,
comp_mappers,
eval_fun = NULL
)
# S3 method for class 'bm_repeat'
ibm_as_taylor(mapper, input, state, ...)
# S3 method for class 'bm_sum'
ibm_as_taylor(mapper, input, state, ...)
# S3 method for class 'bru_comp'
ibm_as_taylor(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
TRUEforibm_n()andibm_values(), the result must be compatible with theINLA::f(...)and correspondingINLA::inla.stack(...)constructions. Foribm_{eval,jacobian,linear}, theinputinterpretation 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 bybm_collect.- derived
The state vectors of variables derived from the root variables. If
NULLor missing, defaults to an empty list.- jacobians
The state vectors of variables derived from the root If
jacobiansisNULLor missing, defaults to an empty list. If notNULL, should be a list with named entries, one for variable derived from the root variables. Each list element should be a named list of Jacobian matrices, with names matching the root variables. Missing entries are treated as all-zero matrices.- data
should be a list with data objects, with the main object called
data; seebm_expr()for details.- multi
logical; If
TRUE(or positive), recurse one level into sub-mappers- comp_mappers
A list of mappers, typically from
as_bm_list<bru_comp_list>.- eval_fun
A list of functions, typically from
bru_eval_fun().
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
Methods (by class)
ibm_as_taylor(default): Callsibm_eval2()and returns a bm_taylor object.
See also
Other mapper methods:
bru_mapper_generics,
ibm_eval(),
ibm_eval2(),
ibm_inla_subset(),
ibm_invalid_output(),
ibm_is_linear(),
ibm_is_rowwise(),
ibm_jacobian(),
ibm_n(),
ibm_n_output(),
ibm_names(),
ibm_simplify(),
ibm_values()