bm_aggregate {inlabru} | R Documentation |
Mapper for aggregation
Description
Constructs a mapper that aggregates elements of the input state, so it can be used e.g. for weighted summation or integration over blocks of values.
Usage
bm_aggregate(rescale = FALSE, n_block = NULL, type = NULL)
bru_mapper_aggregate(...)
## S3 method for class 'bm_aggregate'
ibm_n(mapper, ..., input = NULL, state = NULL, n_state = NULL)
## S3 method for class 'bm_aggregate'
ibm_n_output(mapper, input = NULL, ...)
## S3 method for class 'bm_aggregate'
ibm_values(mapper, ..., state = NULL, n_state = NULL)
## S3 method for class 'bm_aggregate'
ibm_jacobian(mapper, input, state = NULL, ...)
## S3 method for class 'bm_aggregate'
ibm_eval(mapper, input, state = NULL, ..., sub_lin = NULL)
Arguments
rescale |
logical; For
|
n_block |
Predetermined number of output blocks. If |
type |
character; if non-NULL, overrides the |
... |
Arguments passed on to other methods |
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 |
n_state |
integer giving the length of the state vector for mappers that have state dependent output size. |
sub_lin |
Internal, optional pre-computed sub-mapper information |
Methods (by generic)
-
ibm_jacobian(bm_aggregate)
:input
should be a list with elementsblock
andweights
.block
should be a vector of the same length as thestate
, orNULL
, withNULL
equivalent to all-1. Ifweights
isNULL
, it's interpreted as all-1.
See Also
bru_mapper, bru_mapper_generics
Other mappers:
bm_collect()
,
bm_const()
,
bm_factor()
,
bm_fmesher()
,
bm_harmonics()
,
bm_index()
,
bm_linear()
,
bm_logsumexp()
,
bm_marginal()
,
bm_matrix()
,
bm_mesh_B()
,
bm_multi()
,
bm_pipe()
,
bm_repeat()
,
bm_scale()
,
bm_shift()
,
bm_sum()
,
bm_taylor()
,
bru_get_mapper()
,
bru_mapper()
,
bru_mapper.fm_mesh_1d()
,
bru_mapper.fm_mesh_2d()
,
bru_mapper_generics
Examples
m <- bm_aggregate()
ibm_eval2(m, list(block = c(1, 2, 1, 2), weights = 1:4), 11:14)
ibm_eval2(m, list(block = c(1, 2, 1, 2), weights = 1:4, n_block = 3), 11:14)