Constructs a rowwise Kronecker product mapping
bru_mapper_multi(mappers)# S3 method for bru_mapper_multi
ibm_n(mapper, inla_f = FALSE, multi = FALSE, ...)
# S3 method for bru_mapper_multi
ibm_n_output(mapper, input, ...)
# S3 method for bru_mapper_multi
ibm_values(mapper, inla_f = FALSE, multi = FALSE, ...)
# S3 method for bru_mapper_multi
ibm_is_linear(mapper, multi = FALSE, ...)
# S3 method for bru_mapper_multi
ibm_jacobian(
mapper,
input,
state = NULL,
inla_f = FALSE,
multi = FALSE,
...,
sub_A = NULL
)
# S3 method for bru_mapper_multi
ibm_linear(mapper, input, state, inla_f = FALSE, ...)
# S3 method for bru_mapper_multi
ibm_eval(
mapper,
input,
state = NULL,
inla_f = FALSE,
...,
jacobian = NULL,
pre_A = deprecated()
)
# S3 method for bru_mapper_multi
ibm_invalid_output(mapper, input, state, inla_f = FALSE, multi = FALSE, ...)
# S3 method for bru_mapper_multi
[(x, i, drop = TRUE)
# S3 method for bru_mapper_multi
ibm_names(mapper)
# S3 method for bru_mapper_multi
ibm_names(mapper) <- value
[
-indexing a bru_mapper_multi
extracts a subset
bru_mapper_multi
object (for drop FALSE
) or an individual sub-mapper
(for drop TRUE
, and i
identifies a single element)
A list of bru_mapper
objects
A mapper S3 object, inheriting from bru_mapper
.
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 bru_mapper_collect
.
logical;
If TRUE
(or positive), recurse one level into sub-mappers
Arguments passed on to other methods
Data input for the mapper.
A vector of latent state values for the mapping,
of length ibm_n(mapper, inla_f = FALSE)
Internal; precomputed Jacobian matrices.
For ibm_eval()
methods, an optional pre-computed Jacobian, typically
supplied by internal methods that already have the Jacobian.
object from which to extract element(s)
indices specifying element(s) to extract
logical;
For [.bru_mapper_multi
, whether to extract an individual mapper when
i
identifies a single element. If FALSE
, a list of sub-mappers is
returned (suitable e.g. for creating a new bru_mapper_multi
object).
Default: TRUE
a character vector of up to the same length as the number of mappers in the multi-mapper x
ibm_names(bru_mapper_multi)
: Returns the names from the sub-mappers list
ibm_jacobian
for bru_mapper_multi
accepts a list with
named entries, or a list with unnamed but ordered elements.
The names must match the sub-mappers, see ibm_names.bru_mapper_multi()
.
Each list element should take a format accepted by the corresponding
sub-mapper. In case each element is a vector, the input can be given as a
data.frame with named columns, a matrix with named columns, or a matrix
with unnamed but ordered columns.
ibm_invalid_output
for bru_mapper_multi
accepts a list with
named entries, or a list with unnamed but ordered elements.
The names must match the sub-mappers, see ibm_names.bru_mapper_multi()
.
Each list element should take a format accepted by the corresponding
sub-mapper. In case each element is a vector, the input can be given as a
data.frame with named columns, a matrix with named columns, or a matrix
with unnamed but ordered columns.
bru_mapper, bru_mapper_generics
Other mappers:
bru_get_mapper()
,
bru_mapper()
,
bru_mapper.fm_mesh_1d()
,
bru_mapper.fm_mesh_2d()
,
bru_mapper_aggregate()
,
bru_mapper_collect()
,
bru_mapper_const()
,
bru_mapper_factor()
,
bru_mapper_generics
,
bru_mapper_harmonics()
,
bru_mapper_index()
,
bru_mapper_linear()
,
bru_mapper_logsumexp()
,
bru_mapper_marginal()
,
bru_mapper_matrix()
,
bru_mapper_mesh_B()
,
bru_mapper_pipe()
,
bru_mapper_scale()
,
bru_mapper_shift()
,
bru_mapper_taylor()
(m <- bru_mapper_multi(list(
a = bru_mapper_index(2),
b = bru_mapper_index(3)
)))
ibm_eval2(m, list(a = c(1, 2, 1), b = c(1, 3, 2)), 1:6)
Run the code above in your browser using DataLab