Implementations must return a bru_mapper object.
The default method returns the result of ibm_linear()
for linear/affine
mappers, and the original mapper
for non-linear mappers.
Usage
ibm_simplify(mapper, input = NULL, state = NULL, ...)
# Default S3 method
ibm_simplify(mapper, input = NULL, state = NULL, ...)
# S3 method for class 'bm_pipe'
ibm_simplify(
mapper,
input = NULL,
state = NULL,
inla_f = FALSE,
...,
n_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
foribm_n()
andibm_values()
, the result must be compatible with theINLA::f(...)
and correspondingINLA::inla.stack(...)
constructions. Foribm_{eval,jacobian,linear}
, theinput
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 bybm_collect
.- n_state
integer giving the length of the state vector for mappers that have state dependent output size.
Value
The original mapper is returned for non-linear mappers, and the
output of ibm_linear()
is returned for linear mappers.
Methods (by class)
ibm_simplify(default)
: Callsibm_linear()
for linear mappers, and returns the original mapper for non-linear mappers.ibm_simplify(bm_pipe)
: Constructs a simplifiedpipe
mapper. For fully linear pipes, callsibm_linear()
. For partially non-linear pipes, replaces each sequence of linear mappers with a singlebm_taylor()
mapper, while keeping the full list of original mapper names, allowing the originalinput
structure to be used also with the simplified mappers, since thetaylor
mappers are not dependent on inputs.
See also
Other mapper methods:
bru_mapper_generics
,
ibm_eval()
,
ibm_eval2()
,
ibm_inla_subset()
,
ibm_invalid_output()
,
ibm_is_linear()
,
ibm_jacobian()
,
ibm_linear()
,
ibm_n()
,
ibm_n_output()
,
ibm_names()
,
ibm_values()
Other specific bm_pipe method implementations:
bm_pipe()
,
ibm_eval()
,
ibm_eval2()
,
ibm_jacobian()
,
ibm_n()
,
ibm_n_output()
,
ibm_values()