Skip to contents

Create mapper for an fm_mesh_1d object

Usage

# S3 method for fm_mesh_1d
bru_mapper(mesh, indexed = NULL, ...)

# S3 method for bru_mapper_fm_mesh_1d
ibm_n(mapper, ...)

# S3 method for bru_mapper_fm_mesh_1d
ibm_values(mapper, ...)

# S3 method for bru_mapper_fm_mesh_1d
ibm_jacobian(mapper, input, ...)

# S3 method for inla.mesh.1d
bru_mapper(mesh, indexed = NULL, ...)

# S3 method for bru_mapper_inla_mesh_1d
ibm_n(mapper, ...)

# S3 method for bru_mapper_inla_mesh_1d
ibm_values(mapper, ...)

# S3 method for bru_mapper_inla_mesh_1d
ibm_jacobian(mapper, input, ...)

Arguments

mesh

An fm_mesh_1d or inla.mesh.1d object to use as a mapper

indexed

logical; If TRUE, the ibm_values() output will be the integer indexing sequence for the latent variables (needed for spde models). If FALSE, the knot locations are returned (useful as an interpolator for rw2 models and similar). Default: NULL, to force user specification of this parameter

...

Arguments passed on to other methods

mapper

A mapper S3 object, inheriting from bru_mapper.

input

Data input for the mapper.

Functions

  • bru_mapper(inla.mesh.1d): Create mapper for an inla.mesh.1d object; converts the mesh fo fm_mesh_1d first.

Examples

m <- bru_mapper(fm_mesh_1d(c(1:3, 5, 7)), indexed = FALSE)
ibm_values(m)
#> [1] 1 2 3 5 7
ibm_eval(m, 1:7, 1:5)
#> [1] 1.0 2.0 3.0 3.5 4.0 4.5 5.0
m <- bru_mapper(fm_mesh_1d(c(1:3, 5, 7)), indexed = TRUE)
ibm_values(m)
#> [1] 1 2 3 4 5
ibm_eval(m, 1:7, 1:5)
#> [1] 1.0 2.0 3.0 3.5 4.0 4.5 5.0