| ibm_simplify | R Documentation |
Implementations must return a bru_mapper object.
The default method returns the result of ibm_as_taylor() for linear/affine
mappers, and the original mapper for non-linear mappers.
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
)
mapper |
A mapper S3 object, inheriting from |
input |
Data input for the mapper. |
state |
A vector of latent state values for the mapping,
of length |
... |
Arguments passed on to other methods |
inla_f |
logical; when |
n_state |
integer giving the length of the state vector for mappers that have state dependent output size. |
The original mapper is returned for non-linear mappers, and the
output of ibm_as_taylor() is returned for linear mappers.
ibm_simplify(default): Calls ibm_as_taylor() for linear mappers, and returns the original mapper
for non-linear mappers.
ibm_simplify(bm_pipe): Constructs a simplified pipe mapper. For fully linear pipes, calls
ibm_as_taylor().
For partially non-linear pipes, replaces each sequence of linear mappers with
a single bm_taylor() mapper, while keeping the full list of
original mapper names, allowing the original input structure to be used
also with the simplified mappers, since the taylor mappers are not
dependent on inputs.
Other mapper methods:
bru_mapper_generics,
ibm_as_taylor(),
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_values()
m <- bm_linear()
ibm_simplify(m, input = c(1, 3, 4, 5, 2), state = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.