Skip to contents

Model construction and estimation

Functions for constructing models and performing estimation.

inlabru-package inlabru
inlabru
bru() bru_rerun()
Convenient model fitting using (iterated) INLA
bru_options() as.bru_options() bru_options_default() bru_options_check() bru_options_get() bru_options_set() bru_options_reset()
Create or update an options objects
component()
Latent model component construction
component_eval()
Evaluate component values in predictor expressions
component_list() c(<component_list>) c(<component>) `[`(<component_list>)
Methods for inlabru component lists
like() like_list() c(<bru_like>) c(<bru_like_list>) `[`(<bru_like_list>)
Observation model construction for usage with bru()
lgcp()
Log Gaussian Cox process (LGCP) inference using INLA

Posterior evaluation

Functions for evaluating posterior properties.

generate()
Generate samples from fitted bru models
predict(<bru>)
Prediction from fitted bru model
spde.posterior()
Posteriors of SPDE hyper parameters and Matern correlation or covariance function.
deltaIC()
Summarise DIC and WAIC from lgcp objects.
devel.cvmeasure()
Variance and correlations measures for prediction components

Optimization log information

Accessing the optimization text log, and plotting the optimization convergence.

bru_log() print(<bru_log>) as.character(<bru_log>) `[`(<bru_log>) c(<bru_log>) length(<bru_log>)
Access methods for bru_log objects
bru_log_bookmark() bru_log_bookmarks()
Methods for bru_log bookmarks
bru_log_message()
Add a log message
bru_log_new()
Create a bru_log object
bru_log_offset() bru_log_index()
Position methods for bru_log objects
bru_log_reset()
Clear log contents
bru_convergence_plot()
Plot inlabru convergence diagnostics
bru_timings_plot()
Plot inlabru iteration timings

Mapper methods

Functions for bru_mapper handling.

bru_get_mapper() bru_get_mapper_safely()
Extract mapper information from INLA model component objects
bru_mapper() bru_mapper_define()
Constructors for bru_mapper objects
bru_mapper_aggregate() ibm_n(<bru_mapper_aggregate>) ibm_n_output(<bru_mapper_aggregate>) ibm_values(<bru_mapper_aggregate>) ibm_jacobian(<bru_mapper_aggregate>) ibm_eval(<bru_mapper_aggregate>)
Mapper for aggregation
bru_mapper_collect() ibm_n(<bru_mapper_collect>) ibm_n_output(<bru_mapper_collect>) ibm_values(<bru_mapper_collect>) ibm_is_linear(<bru_mapper_collect>) ibm_jacobian(<bru_mapper_collect>) ibm_eval(<bru_mapper_collect>) ibm_linear(<bru_mapper_collect>) ibm_invalid_output(<bru_mapper_collect>) `[`(<bru_mapper_collect>) ibm_names(<bru_mapper_collect>) `ibm_names<-`(<bru_mapper_collect>)
Mapper for concatenated variables
bru_mapper_const() ibm_n(<bru_mapper_const>) ibm_values(<bru_mapper_const>) ibm_jacobian(<bru_mapper_const>) ibm_eval(<bru_mapper_const>)
Constant mapper
bru_mapper_factor() ibm_n(<bru_mapper_factor>) ibm_values(<bru_mapper_factor>) ibm_jacobian(<bru_mapper_factor>)
Mapper for factor variables
bru_mapper(<fm_mesh_1d>) ibm_n(<bru_mapper_fm_mesh_1d>) ibm_values(<bru_mapper_fm_mesh_1d>) ibm_jacobian(<bru_mapper_fm_mesh_1d>) bru_mapper(<inla.mesh.1d>) ibm_n(<bru_mapper_inla_mesh_1d>) ibm_values(<bru_mapper_inla_mesh_1d>) ibm_jacobian(<bru_mapper_inla_mesh_1d>)
Mapper for fm_mesh_1d
bru_mapper(<fm_mesh_2d>) ibm_n(<bru_mapper_fm_mesh_2d>) ibm_values(<bru_mapper_fm_mesh_2d>) ibm_jacobian(<bru_mapper_fm_mesh_2d>) bru_mapper(<inla.mesh>) ibm_n(<bru_mapper_inla_mesh_2d>) ibm_values(<bru_mapper_inla_mesh_2d>) ibm_jacobian(<bru_mapper_inla_mesh_2d>)
Mapper for fm_mesh_2d
ibm_n() ibm_n_output() ibm_values() ibm_is_linear() ibm_jacobian() ibm_linear() ibm_simplify() ibm_eval() ibm_eval2() ibm_names() `ibm_names<-`() ibm_inla_subset() ibm_invalid_output()
Generic methods for bru_mapper objects
bru_mapper_harmonics() ibm_n(<bru_mapper_harmonics>) ibm_jacobian(<bru_mapper_harmonics>)
Mapper for cos/sin functions
bru_mapper_index() ibm_invalid_output(<bru_mapper_index>) ibm_jacobian(<bru_mapper_index>)
Mapper for indexed variables
bru_mapper_linear() ibm_n(<bru_mapper_linear>) ibm_values(<bru_mapper_linear>) ibm_jacobian(<bru_mapper_linear>)
Mapper for a linear effect
bru_mapper_logsumexp() ibm_jacobian(<bru_mapper_logsumexp>) ibm_eval(<bru_mapper_logsumexp>)
Mapper for log-sum-exp aggregation
bru_mapper_marginal() ibm_n(<bru_mapper_marginal>) ibm_n_output(<bru_mapper_marginal>) ibm_values(<bru_mapper_marginal>) ibm_jacobian(<bru_mapper_marginal>) ibm_eval(<bru_mapper_marginal>)
Mapper for marginal distribution transformation
bru_mapper_matrix() ibm_n(<bru_mapper_matrix>) ibm_values(<bru_mapper_matrix>) ibm_jacobian(<bru_mapper_matrix>)
Mapper for matrix multiplication
bru_mapper_mesh_B() ibm_n(<bru_mapper_mesh_B>) ibm_values(<bru_mapper_mesh_B>) ibm_jacobian(<bru_mapper_mesh_B>)
Mapper for basis conversion
bru_mapper_multi() ibm_n(<bru_mapper_multi>) ibm_n_output(<bru_mapper_multi>) ibm_values(<bru_mapper_multi>) ibm_is_linear(<bru_mapper_multi>) ibm_jacobian(<bru_mapper_multi>) ibm_linear(<bru_mapper_multi>) ibm_eval(<bru_mapper_multi>) ibm_invalid_output(<bru_mapper_multi>) `[`(<bru_mapper_multi>) ibm_names(<bru_mapper_multi>) `ibm_names<-`(<bru_mapper_multi>)
Mapper for tensor product domains
bru_mapper_pipe() ibm_n(<bru_mapper_pipe>) ibm_n_output(<bru_mapper_pipe>) ibm_values(<bru_mapper_pipe>) ibm_jacobian(<bru_mapper_pipe>) ibm_eval(<bru_mapper_pipe>) ibm_eval2(<bru_mapper_pipe>) ibm_simplify(<bru_mapper_pipe>)
Mapper for linking several mappers in sequence
bru_mapper_scale() ibm_n(<bru_mapper_scale>) ibm_n_output(<bru_mapper_scale>) ibm_values(<bru_mapper_scale>) ibm_jacobian(<bru_mapper_scale>) ibm_eval(<bru_mapper_scale>)
Mapper for element-wise scaling
bru_mapper_shift() ibm_n(<bru_mapper_shift>) ibm_n_output(<bru_mapper_shift>) ibm_values(<bru_mapper_shift>) ibm_jacobian(<bru_mapper_shift>) ibm_eval(<bru_mapper_shift>)
Mapper for element-wise shifting
bru_mapper_taylor() ibm_n(<bru_mapper_taylor>) ibm_n_output(<bru_mapper_taylor>) ibm_values(<bru_mapper_taylor>) ibm_jacobian(<bru_mapper_taylor>) ibm_eval(<bru_mapper_taylor>)
Mapper for linear Taylor approximations
c(<bru_mapper>) c(<bm_list>) `[`(<bm_list>)
Methods for mapper lists
bru_forward_transformation() bru_inverse_transformation()
Transformation tools

Miscellaneous

Miscellaneous functions.

eval_spatial()
Evaluate spatial covariates
bru_fill_missing()
Fill in missing values in Spatial grids
point2count()
Convert a plot sample of points into one of counts.
sample.lgcp()
Sample from an inhomogeneous Poisson process

Plot helpers

Functions for helping build figures.

plot(<bru>)
Plot method for posterior marginals estimated by bru
plot(<bru_prediction>) plot(<prediction>)
Plot prediction using ggplot2
plotsample()
Create a plot sample.
globe()
Visualize a globe using RGL
gg(<RasterLayer>)
Geom for RasterLayer objects
gg()
ggplot2 geomes for inlabru related objects
gg(<SpatRaster>)
Geom wrapper for SpatRaster objects
gg(<SpatialGridDataFrame>)
Geom for SpatialGridDataFrame objects
gg(<SpatialLines>)
Geom for SpatialLines objects
gg(<SpatialPixels>)
Geom for SpatialPixels objects
gg(<SpatialPixelsDataFrame>)
Geom for SpatialPixelsDataFrame objects
gg(<SpatialPoints>)
Geom for SpatialPoints objects
gg(<SpatialPolygons>)
Geom for SpatialPolygons objects
gg(<bru_prediction>) gg(<prediction>)
Geom for predictions
gg(<data.frame>)
Geom for data.frame
gg(<inla.mesh.1d>)
Geom for inla.mesh.1d objects
gg(<inla.mesh>)
Geom for inla.mesh objects
gg(<matrix>)
Geom for matrix
gg(<sf>)
Geom helper for sf objects
glplot()
Render objects using RGL
gm()
ggplot geom for spatial data
gmap()
Plot a map using extent of a spatial object
bincount()
1D LGCP bin count simulation and comparison with data

Printing methods

Functions for printing.

Data objects

Data objects

Poisson1_1D
1-Dimensional Homogeneous Poisson example.
Poisson2_1D
1-Dimensional NonHomogeneous Poisson example.
Poisson3_1D
1-Dimensional NonHomogeneous Poisson example.
gorillas gorillas
Gorilla nesting sites
gorillas_sf gorillas_sf gorillas_sf_gcov()
Gorilla nesting sites in sf format
mexdolphin
Pan-tropical spotted dolphins in the Gulf of Mexico
mexdolphin_sf
Pan-tropical spotted dolphins in the Gulf of Mexico
mrsea
Marine renewables strategic environmental assessment
robins_subset
robins_subset
seals_sp
Seal pups
shrimp
Blue and red shrimp in the Western Mediterranean Sea
toygroups
Simulated 1D animal group locations and group sizes

Internal helper functions

Helper functions for more low level operations.

evaluate_comp_lin()
Compute all component linearisations
evaluate_index()
Compute all index values
evaluate_inputs()
Compute all component inputs
expand_labels()
Expand labels
inla.stack.mjoin()
Join stacks intended to be run with different likelihoods
spatial.to.ppp()
Convert SpatialPoints and boundary polygon to spatstat ppp object
bru_make_stack()
Build an inla data stack from linearisation information
bru_summarise()
Summarise and annotate data
bru_standardise_names()
Standardise inla hyperparameter names
bru_safe_inla()
Load INLA safely for examples and tests
bru_safe_sp()
Check for potential sp version compatibility issues
bru_call_options()
Additional bru options
bru_compute_linearisation()
Compute inlabru model linearisation information

Re-exported fmesher functions

Functions that used to be part of inlabru but are now in the fmesher package, and re-exported by inlabru for backwards compatibility.

Deprecated methods

Deprecated methods

ipoints()
Generate integration points
pixels()
Generate SpatialPixels covering an inla.mesh
multiplot()
Multiple ggplots on a page.
spoly()
Convert a data.frame of boundary points into a SpatialPolgonsDataFrame
sline()
Convert data frame to SpatialLinesDataFrame