Defines a repeated-space mapper that sums the contributions for
each copy. The ibm_n()
method returns ibm_n(mapper) * n_rep
, and
ibm_values()
returns seq_len(ibm_n(mapper))
.
Usage
bru_mapper_repeat(mapper, n_rep)
# S3 method for class 'bru_mapper_repeat'
ibm_n(mapper, ...)
# S3 method for class 'bru_mapper_repeat'
ibm_n_output(mapper, ...)
# S3 method for class 'bru_mapper_repeat'
ibm_values(mapper, ...)
# S3 method for class 'bru_mapper_repeat'
ibm_jacobian(mapper, input, state = NULL, ..., sub_lin = NULL)
# S3 method for class 'bru_mapper_repeat'
ibm_eval(mapper, input, state, ..., sub_lin = NULL)
# S3 method for class 'bru_mapper_repeat'
ibm_linear(mapper, input, state, ...)
# S3 method for class 'bru_mapper_repeat'
ibm_invalid_output(mapper, input, state, ...)
Arguments
- mapper
The mapper to be repeated.
- n_rep
The number of times to repeat the mapper.
- ...
Arguments passed on to other methods
- input
Data input for the mapper.
- state
A vector of latent state values for the mapping, of length
ibm_n(mapper, inla_f = FALSE)
- sub_lin
Internal, optional pre-computed sub-mapper information
Methods (by generic)
ibm_jacobian(bru_mapper_repeat)
: The input should take the format of the repeated submapper.ibm_invalid_output(bru_mapper_repeat)
: Passes on the input to the corresponding method.
See also
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_fmesher()
,
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_multi()
,
bru_mapper_pipe()
,
bru_mapper_scale()
,
bru_mapper_shift()
,
bru_mapper_taylor()
Examples
m <- bru_mapper_repeat(bru_mapper_index(3), 4)
ibm_n(m)
#> [1] 12
ibm_values(m)
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12
ibm_jacobian(m, 1:3)
#> 3 x 12 sparse Matrix of class "dgCMatrix"
#>
#> [1,] 1 . . 1 . . 1 . . 1 . .
#> [2,] . 1 . . 1 . . 1 . . 1 .
#> [3,] . . 1 . . 1 . . 1 . . 1
ibm_eval(m, 1:3, seq_len(ibm_n(m)))
#> [1] 22 26 30