Changelog
Source:NEWS.md
inlabru (development version)
New features
- Add
bru_names()method for extracting the inlabru standardised names of fixed effects, latent components, and hyperparameters from a fittedbruobject. (version2.13.0.9011) - Add
bm_logitaverage()mapper, for weighted logit-averages (version2.13.0.9010)
Updated features
- Add
bru_get_mapper()support forinla.cgenericobjects, and update the support forinla.rgeneric, to standardise where to store a pre-constructed mapper, so that external packages will no longer need to add their ownbru_get_mapper()methods for their r/cgeneric sub-classes, if the mapper is pre-computed. (version2.13.0.9005) - Remove unused
groupandreplicateparts of each latent component, speeding up component evaluation and linearisation. (version2.13.0.9006) - Allow index extraction from duplicated tags in
bru_index(), returning all matching indices. (version2.13.0.9014) - Code refactor and storage streamlining for
bru_obs()to prepare for future extensions. (version2.13.0.9015) - Add
block_responseelement tobru_obs(aggregate_input)list input, to allow specifying a block-wise response variable to match for aggregated predictors. (version2.13.0.9016)
Bug fixes
- Fix logic for
bru_set_missing<inla.surv>()to correctly handle theinla.surv()class variations (version2.13.0.9002) - Handle changing number of hyperparameters in inla tracing (version
2.13.0.9004) - Robustify internal
extended_bind_rows()method for unifying XY/XYZsfcoordinate columns (version2.13.0.9009)
inlabru 2.13.0
CRAN release: 2025-07-09
New features
- Allow the optional
weightsargument tobru_obs(family = "cp")/lgcp()to contain individual point observation weights, so that theetacontribution to the log-likelihood issum(weights * eta)instead ofsum(eta)(version2.12.0.9006) - Automatically detect purely additive linear models (version
2.12.0.9014) - Add experimental predictor aggregation helper feature
bru_obs(..., aggregate = ..., aggregate_input = ...)to simplify specification of models with aggregation as the final step of the predictor evaluation (version2.12.0.9013, bugfix in2.12.0.9016). Includes support for constructing the aggregation information, viadomain,samplers, or precomputedips(version2.12.0.9022) - Add
bru_set_missing()method for setting missing values in thebru_obsdata, e.g. for use in cross-validation or prior sampling (version2.12.0.9024)
Updates features
- Add automated support for INLA models with hidden states, beyond the “bym” and “bym2” models (version
2.12.0.9002) - Add automatic mapper support for INLA lattice models “rw2d”, “rw2diid”, and “matern2d” (version
2.12.0.9004) - Add
inputsdata to thebru_infoobject, so that the component inputs can be pre-evaluated before automated mapper construction, and avoiding duplicate evaluation iniinla(). This can halve the pre-processing time for large spatial and spatio-temporal models (version2.12.0.9010) - Add
bru_log()data for warnings and errors reported by inlabru (version2.12.0.9011) - Rename
bru_likeobject class tobru_obs(version2.12.0.9017) and temporarily re-reintroducelike_list()andbru_like_list()as aliases forbru_obs_list()(version2.12.0.9020) - Add
quantileargument tospde.posterior()for controlling the credible interval calculations, likematerncov.bands(), which is now also exported (version2.12.0.9019) - Remove
dicandwaicfrom defaultcontrol.computebru_options, to match INLA defaults (version2.12.0.9024)
New and updated mapper features
- The standard mapper class names have been shortened from
bru_mapper_<type>tobm_<type>, to make code using them more readable. Objects of the old class names will be converted to the new classes internally, so that old stored objects will still work. Constructors of the formbru_mapper_<type>()call the corresponding new constructorbm_<type>()(version2.12.0.9021) - Add
bm_sum()mapper, for automated adding the output of multiple mappers, optionally with a single common input (version2.12.0.9001) - Add
interleavedoption tobm_repeat()to allow interleaved states for summation of a repeated mapper (version2.12.0.9001) - Allow
n_blockininputargument tobm_aggregateandbm_logsumexpevaluation methods, overriding the optional mapper object setting (version2.12.0.9005) - (Note: due to the difficulty of ensuring correct output ordering, and
fmesherwill refusecharacterblock input from version0.5.0. Was: Allowcharacterblock information inbm_aggregateandbm_logsumexpmappers, fromfmesherversion0.2.0.9017(version2.12.0.9013)) - Expanded auto-detection of component sizes by checking
Cmatrixandgrapharguments, if present andnisNULL(version2.12.0.9012) - Code refactor to expand
bm_listmapper list handling, removing unnecessary method layers for component linearisation and simplification (version2.12.0.9018)
Bugfixes and deprecations
- Give deprecation warnings for
Spatialobject inputs tobru_obs(), as maintaining the fallback support code is becoming increasingly time-consuming, and thesfpackage is now the recommended spatial data handling package. (version2.12.0.9023) - Bugfix for
generate.bru()for evaluation of expressions in the absence ofnewdata(version2.12.0.9007) - Use
midlocations foribm_values()for non-indexedfm_mesh_1dmapper (version2.12.0.9009) - Deprecate the
includeandexcludearguments topredict()andgenerate()(version2.12.0.9003) - Assumed that
NROW()on the main component gave the correct size forgroupandreplicatein the component_eval()feature. Now usesibm_n_output()instead. Fixes #271 (version2.12.0.9015)
inlabru 2.12.0
CRAN release: 2024-11-21
General changes
- Introduce
bru_obs()as a replacement tolike(), to help avoid namespace clashes with e.g.data.table::like()(version2.11.1.9026) - Change logic for
bru_obs(allow_combine)/like()to allow user override, and add warnings for ambiguous cases (version2.11.1.9011) - Add
bru_response_size()method for extracting the response size for each observationbru_obsobject (version2.11.1.9013) - Add
sfoutput format support forslineandspoly(version2.11.1.9006) - Add
[and]to special character set inbru_standardise_names()(version2.11.1.9012) - Add
bru_index()method for accessing predictor index information for sub-models, and atagargument forbru_obs()to identify individual sub-models by name, which is also propagated to lists ofbru_likeobjects (version2.11.1.9017and2.12.0) - Allow
bru_mapper_multi()sub-mappers to have non-zero offsets, that are added to generate the combined offset (version2.11.1.9019) - Add general
bru_mapper_fmesher()mapper, for indexed mapping of all objects supportingfm_dof()andfm_basis()(version2.11.1.9021) - Add
bru_mapper_repeat()mapper, for automated single-mapper sums (version2.11.1.9022)
Data set updates
- Convert
mrseatosfformat (version2.11.1.9009) - Convert the
shrimpdata set tosfformat (version2.11.1.9007) - Remove
seals_spdata set due to excessive size (version2.11.1.9010) - Replace the
mexdolphindataset with a functionmexdolphin_sp()to avoidspdata objects in the package (version2.11.1.9015) - Replace the
gorillasdataset with a functiongorillas_sp()to avoidspdata objects in the package (version2.11.1.9016)
Namespace changes
- Move
spfromImportstoSuggests. Component definitions usingcoordinatesas input require eithersp::coordinatesorsphaving been already loaded with e.g.library(sp)(version2.11.1.9003) - Remove
ggmapsupport (version2.11.1.9002) - Remove unnecessary
INLAnamespace loading inggplotmethods (version2.11.1.9008) - Move
terrafromImportstoSuggests(version2.11.1.9014) - Stop re-exporting
fmeshermethods (version2.11.1.9020)
Deprecated methods
- Deprecated (since 2.8.0) method
is.inside()have been removed. Usefmesher::fm_is_within()instead. - Deprecated (since 2.7.0)
bru_mapper.default()to define new mapper classes has been removed. Usebru_mapper_define()instead. - Deprecated (since 2.6.0)
bru_mapper_offset()method has been removed. Usebru_mapper_const()instead.
Internal changes
- Remove unneeded
"list"class inheritance from solitary classes (version2.11.1.9001) - Expand the
summaryandprintmethod class coverage (version2.11.1.9002) - Reduced the amount of diagnostic messages in
bru_safe_inla()(version2.11.1.9005) - Change name of
componentandcomponent_listmethods tobru_componentandbru_component_list(version2.11.1.9026)
inlabru 2.11.0
New features
- Add support for the
scaleparameter tolike(). - Add support for special response objects like
inla.mdata()andinla.surv(), when INLA version> 24.06.02(formdata) or> 24.06.26(forsurv) are available (version2.10.1.9011) - New
toypointsexample data set, for basic modelling examples (version2.10.1.9003)
Feature updates
- Updated convergence plots, reducing random effect aspects to summary statistics, improving speed and visual coherence (version
2.10.1.9004) - Add options to
bru_convergence_plot()to control the number of iterations shown, and optionally show the initial values that are stored from this version (version2.10.1.9005) - Switch timing mechanism from
Sys.time()toproc.time()to capture CPU time instead of elapsed clock time. Addedbru_timings()method to extract the timings safely from a fittedbruobject (version2.10.1.9007and2.10.1.9010) - Add verbosity level information to the bru log data structure, allowing filtered log extraction and more flexible log display (version
2.10.1.9012)
Bug fixes
- Fix regression bug in
"bym"model support, where the latent state size wasn’t correctly handled by the mapper system (version2.10.1.9002) - Add filter to limit mapper construction to only the components used in the predictor expression, to avoid unused components breaking the initialisation. This allows easier testing of multi-likelihood models (version
2.10.1.9006) - Improved backwards compatibility support for
spdata input forfamily = "cp"(version2.10.1.9008)
Deprecated methods
- Deprecated (since 2.9.0) method
ipoints(samplers, domain)is no longer available. Usefmesher::fm_int(domain, samplers)instead. - The
allow_latent,include_latentarguments tolike()have been deprecated in favour of the generalbru_used()framework, that auto-detects what component effects and latent effects are used by a predictor expression. - The deprecated (since 2.8.0)
cprod()method now gives a warning and will be removed in a future version. Usefmesher::fm_cprod()instead. - The
integration_weight_aggregationmethod has been removed (deprecated since 2.8.0). Usefmesher::fm_vertex_projection()instead. - The
mesh_triangle_integrationmethod has been removed (deprecated since 2.8.0). Usefmesher::fm_int()instead. - Old use of
bru_mapper.default()to define new mapper classes has been disabled (deprecated since 2.7.0). Usebru_mapper_define()instead. - Deprecated (since 2.8.0) methods
is.inside(),vertices.inla.mesh(), andpixels()have been disabled. Usefmesher::fm_is_within(),fmesher::fm_vertices(), andfmesher::fm_pixels()instead.
inlabru 2.10.1
CRAN release: 2023-12-21
Feature updates
- Add new web article on ZIP/ZAP models (zero inflated Poisson models) where the non-zero probability is modelled with a separate predictor from the predictor for the Poisson model parameter: https://inlabru-org.github.io/inlabru/articles/zip_zap_models.html. (Thanks to Dmytro Perepolkin)
Bug fixes and dependency simplification
- Remove dependence on the
ggpolypathpackage, and theggplot2::fortify.SpatialPolygons/DataFrame()methods that were deprecated inggplot2version3.4.4. Code usinggg.SpatialPolygons()together withcoord_fixed()/coord_equal()for coordinate axis control needs to usecoord_sf()instead. - Detect the need for vectorised parameters in
bru_forward_transformationto allowbru_mapper_marginalto be applied with e.g. spatially varying parameters. (version2.10.0.9001) - Detect
terraversion>= 1.7-66that removes the need for detecting special cases (nrow(where) == 1andterra::nlyr(data) == 1). Workaround code used for versions< 1.7-66. (version2.10.0.9002) (Thanks to Robert J. Hijmans)
inlabru 2.10.0
CRAN release: 2023-10-29
Feature updates
- Add new
ibm_simplify()generic to handle mapper simplification more generally; needed to properly support non-linear component mappers. (version2.9.0.9004) - Add new
bru_mapper_marginal()mapper class that can be used as part of component mapper pipelines. (version2.9.0.9004) - Add new
ibm_eval2()generic that computes both evaluation and Jacobian, avoiding double-computing of the Jacobian, when practical. (version2.9.0.9005) - Add new
bru_timings_plot()function that plots the time used for each nonlinear iteration (version2.9.0.9007) - Speed up
bru_fill_missing()(by orders of magnitude) by changing method for finding the nearest available data point. (version2.9.0.9011) - Add new
bru_mapper_shift()mapper class that works likebru_mapper_scale()but for additive shifts instead of multiplicative scaling. (version2.9.0.9012) - Added more checks for invalid component or predictor evaluations, to help catch user errors sooner, and with more informative messages. (version
2.9.0.9013) - Expand
bru_mapper_matrix, previously used only for componentmodel = "fixed", to allow integer indexing in addition to the previous factor/character-only indexing. (version2.9.0.9014)
Bug fixes
- The
is_linearflag wasn’t correctly set forbru_mapper_logsumexpmappers. Since previous versions did not accept non-linear component mappers, this is unlikely to have affected any user code. (Fixed in version2.9.0.9001) - Improved error messages for missing or incomplete LGCP domain specification. (version
2.9.0.9002and2.9.0.9006) - Allow
NULLin automatic component usage detection. (version2.9.0.9003) - Corrected the crs information for
gorillas$plotsample$countsandgorillas_sf$plotsample$countsfrom+units=mto+units=km. (version2.9.0.9010) The geometry information incountsis unlikely to have been used in examples or analysis code, as the problem would have been immediately obvious; plotting or other geometric operations that use the crs information would heve been completely wrong, and is only detected now that more code uses the crs information at all. Thanks to Dmytro Perepolkin for reporting in issue #205 - Fix problem in
bru_fill_missing()for cases where the input data object also has missing values. (version2.9.0.9011) - Make
eval_spatial()transform thewherecoordinates to the same crs as the input data, forSpatRasterandsfinputs, to allow different crs specifications. (version2.9.0.9012)
inlabru 2.9.0
CRAN release: 2023-08-28
Feature updates
Conversion of code to use
fmesherfor mesh and geometry handling; the interface supports existing objects and methods. See https://inlabru-org.github.io/fmesher/articles/inla_conversion.html for more information.General speed improvements, see below for details.
Added
gg.sf()method.Add experimental support for
starsviaeval_spatial(). (version2.8.0.9007)Move the
sppackage from ‘Depends’ to ‘Imports’. This means that user code should either usesp::orlibrary("sp")to accessspmethods. Thebru_safe_sp()helper function can be used to check for a safesppackage configuration during the transition fromrgdaltosf, and is only needed if you may run on systems withspinstallations older than “2.0-0” or withsp::get_evolution_status() < 2. (version2.8.2011)-
Now preserves the previous log output when using
bru_rerun(), andbru_log()is now a set of S3 methods, supporting extracting the full inlabru log as wellbru-object specific logs (version2.8.0.9008).Note: From version
2.9.0, usebru_log()to access the global log, andbru_log(fit)to access a stored estimation log.Up to version
2.8.0,bru_log()was a deprecated alias forbru_log_message(). When running on2.8.0or earlier, usebru_log_get()to access the global log, andcat(fit$bru_iinla$log, sep = "\n")to print a stored estimation object log.
Bug fixes and speed improvements
- Covariate object component inputs of type
SpatialPolygonsDataFramewere not automatically passed on toeval_spatial(). The logic has now changed so that any object with aeval_spatial()method will trigger a call toeval_spatial(). See?input_evalfor further information. (version2.8.0.9001) -
fm_crs_is_null(),fm_transform()now supports obliquefm_crsCRS objects, andis.na()methods for thefm_crsandinla.CRSclasses have been added. (version2.8.0.9003) - Significant speed up
predict()by usingquantile(..., names = FALSE). (version2.8.0.9004) - Improved
row_kron()code, causing speedups of a factor 2-30 in randomised test cases. (version2.8.0.9005) - Removed incorrect code for
sfmethod foreval_spatial(), causing failure when extracting from multiple layers in a single call. (version2.8.0.9007) - Improved handling of posterior sample variable extraction in
generate()andpredict(). Now much faster for large models. (version2.8.0.9009) - Fixed linearisation issue when using only the
*_latentform of a component. (version2.8.0.9015) - Workaround for equivalent but textually different CRS/WKT information in
bru_fill_missing(). (version2.8.0.9016, fixes #200)
Deprecation of old functions
-
eval_SpatialDFremoved, deprecated since2.8.0. Seeeval_spatialinstead. -
stransform,ibm_amatrix,ibm_valid_inputremoved, deprecated since2.7.0. Seefm_transformandibm_jacobianinstead. -
bru_mapper_offset, deprecated since2.6.0now returns a purebru_mapper_constobject, and allbru_mapper_offsetibm_*methods have been removed. -
init.tutorialremoved, deprecated since2.5.0 -
generate.inlaandpredict.inlaremoved, deprecated since2.1.0
inlabru 2.8.0
CRAN release: 2023-06-20
Feature updates
The iterative inla method has been given both sharper internal
inla()optimisation criteria for the iterations (thanks to Haavard Rue), and a more relaxed nonlinear iteration stopping criterion; the defaultbru_method$rel_tolvalues has been changed from 1 to 10 percent change. The iterations are terminated when all latent and hyper-parameter mode changes fullfil|change|/SD < rel_tol, and the non-linear line search is inactive. This seems to strike a useful balance between the different optimisation criteria, allowing the iterations to converge faster and also detect that convergence sooner.-
The logic for which components are needed for a predictor expression (in
like()orgenerate()/predict()) has been updated to when possible extract the list of components from the expression itself. The user can override this default if necessary, using theinclude/excludearguments.The
bru_used()methods are used to guess the needed component names, applied to the right-hand side of theformulaarguments. Theallow_latentargument tolike()has been deprecated in favour ofinclude_latent(by default auto-detected for use of_latentand_eval).The internal information storage is handled by the new
bru_used()methods, that can also be used directly by the user and supplied via theusedargument tolike()/generate()/predict(). Add
fm_int()integration methods, replacing the oldipmaker()andipoints()methods. Supports bothsfandspsampler objects.Add
fm_pixels()methods for gridded points. The oldpixels()method now callsfm_pixels(..., format = "sp")eval_spatialsupport for sf objects (for point-in-polygon data lookups)Allow precomputed spatial covariates in the data for point process observations
Add
edge|int|ext.linewidtharguments togg.inla.mesh#188Rename the
predict()andgenerate()dataarguments tonewdata, for better compatibility with otherpredict()methods. The old argument name will still be accepted, but give a warning. Code that does not name thedataargument is not affected.-
Note: Coordinate names for
Spatial*objects have been inconsistently available in the predictor expression evaluation. However, due to how internal conversions might inadvertently change these names, they can not be relied on, and they are no longer being made available to the predictor expression. As a side effect, this change also speeds up somebru()runs by around a factor 2, since it avoids converting theSpatial*to a regulardata.framein time-sensitive core evaluation code.If you need access to the raw coordinate values, use explicit calls to
sp::coordinates(.data.)(e.g. for custom spatial covariate evaluation.). When possible, use the built-in covariate evaluation method,eval_spatial(), either implicitly withcomp(covariate, ...)or explicitly,comp(eval_spatial(covariate, where = .data.), ...), that handlescrsinformation correctly. Also consider transitioning fromsptosfdata storage, usinggeometryinstead of raw coordinates.
Bug and dependency updates
- Remove
rgdalandmaptoolsdependencies #178 - Add
bru_safe_sp()to check ifspcan be used safely (checksrgdalavailability andspevolution status, optionally forcing use ofsf) #178 - Remove PROJ4 support #178
- Change
rgl.*functions to*3d. Thanks to Duncan Murdoch #181 - Speed up
ibm_jacobian.bru_mapper_harmonicsfor large models - Add workarounds for inconsistent polygon orientation resulting from
sf::st_*calls that don’t account for thegeoscanonical representation being CW, whereas the canonical Simple Features representation being CCW. See https://github.com/r-spatial/sf/issues/2096
inlabru 2.7.0
CRAN release: 2022-12-02
Feature overview
- Added support for
sfandterrainputs to most methods - Expanded geometry and mesh handling methods
- Expanded
bru_mapper()system - Added convergence diagnostics plot with
bru_convergence_plot()
Feature details
Allow
NAinput for default 1D mappers to generate effect zero, like ininla().New and expanded methods
fm_crs(),fm_CRS(),fm_transform(),fm_ellipsoid_radius(), andfm_length_unit()to further supportsfobjects. Thefm_crs()extraction method also supportsterraobjects.bru_fill_missing()now supportsterraSpatRasterdata and andsflocations.New experimental methods
fm_evaluator()andfm_evaluate(), replacing theINLAinla.mesh.projectorandinla.mesh.projectmethods.Experimental integration support for sphere and globe meshes.
Allow
sfinput tofamily="cp"models.-
Further
bru_mapper()method updates;- Deprecated
ibm_amatrix()andnames()methods, replaced byibm_jacobian()andibm_names(). - Introduced
bru_mapper_pipe(), used to link mappers in sequence. - Introduced
bru_mapper_aggregate()andbru_mapper_logsumexp(), used for blockwise weighted sums and log-sum-exp mappings,output[k] = sum(weights[block==k]*state[block==k])))andoutput[k] = log(sum(weights[block==k]*exp(state[block==k]))), with optional weight normalisation within each block. Allows providing the weights as log-weights, and uses block-wise shifts to avoid potential overflow. -
summarymethods forbru_mapperobjects (summary.bru_mapper()) - Removed
methodsargument frombru_mapper_define(). Implementations should register S3 methods instead.
- Deprecated
Bug fixes
- Remove unused
spatstat.coredependency. Fixes #165 - Fixed issue with plain mapper evaluation in the
ibm_eval.default()andibm_eval.bru_mapper_collect()methods, where they would return zeros instead of the intended values. The main component evaluation and estimation code was not directly affected as that is based on thebru_mapper_multi()class methods that rely on the Jacobians instead. The bug would therefore mainly have impacted the future, not yet supported nonlinear mapper extensions. - Fix for
eval_spatial.SpatRaster; Work around inconsistent logic interra::extract(..., layer)whenlength(layer)==1ornrow(where)==1. Fixes #169 - Add
indexedlogical option tobru_mapper_factor(), to allow factor inputs to be mapped to index values, as needed forgroupandreplicate. Fixes #174
inlabru 2.6.0
CRAN release: 2022-10-24
Features
Add
bru_get_mappergeneric, and associated methods forinla.spdeandinla.rgenericobjects. This allowsinlabruto automatically extract the appropriatebru_mapperobject for each model component, and can be used as a hook by external packages implementing new INLA object classes.Add a
weightsargument forlike(), for likelihood-specific log-likelihood weights, passed on to theINLA::inla()weights argument. Evaluated in the data context.The
<component>_eval()methods available in predictor expressions now handle optional scaling weights, like in ordinary component effect evaluation.Add
terrasupport for covariate inputsThe component
*_layerarguments are now evaluated in the data context, to allow dynamic layer selection for spatial raster covariates. A new genericeval_spatial()provides support for grid/pixel basedSpatial*DataFrameevaluation, andSpatRaster. Expanded support is in progress.New vignettes on the
bru_mappersystem,componentdefinitions, andprediction_scores-
General overhaul of the
bru_mapperand linearised predictor system, to prepare for new features.- Add
ibm_evalgeneric for evaluating mappers for given states. - Add
bru_mapper_taylor, used as an internal mapper for linearised mappers. This andibm_evalis aimed at future support for nonlinear mappers. Associated new generic methods:ibm_{is_linear,jacobian,linear}. - New mapper implementations should use
ibm_jacobianinstead ofibm_amatrix. This allows defining a linearised mapper viaibm_eval(input, state0) + ibm_jacobian(input, state0) %*% (state - state0). - New mapper class
bru_mapper_const, which replacesbru_mapper_offset.bru_mapper_offsetis now deprecated and will produce warnings.
- Add
inlabru 2.5.3
CRAN release: 2022-09-05
Features
- Add
bru_mapper_harmonicsmapper forcosandsinbasis sets. - Allow
predict()input data to be be a list. - Allow arbitrary quantile summaries in
predict() - Remove
cv,var,smin,smaxsummaries frompredict() - Add
mean.mc_std_errandsd.mc_std_erroutput topredict() - Add
robins_subsetdata set and associated variable coefficient web vignette
Bug fixes
- Propagate multi-likelihood A-matrix information instead of recomputing. Fixes iteration issue for bym2 and other
bru_mapper_collectmodels. - Turn on predictor summaries during iterations to allow
inla.mode="classic"to use proper line search. - Avoid deprecated Matrix (>=1.4-2) class coercion methods
- Work around for lack of full Matrix and ModelMatrix support for the
uniquemethod. Fixes #145
inlabru 2.5.2
CRAN release: 2022-03-30
- More robust package checks
- More robust namespace and INLA availability checks
- Add package vignette with links to the website examples
inlabru 2.5.1
- Revert to R language features compatible with R 4.0.5
- Use
strategy="gaussian"during iterations.
inlabru 2.5.0
CRAN release: 2022-03-21
Features
- Add
bru()timing information in$bru_timingsand$bru_iinla$timings - Add
SpatialPolygonsDataFramesupport togg()methods - Allow accessing
EandNtrialsfromresponse_dataanddata(further special arguments remain to be added) -
deltaICimprovements - New transformation helper tools
bru_{forward/inverse}_transformation() - Experimental support for matrix and formula component inputs. E.g. with
~ name(~ -1 + a + b + a:b, model = "fixed"), covariate fixed effect interaction specifications can be made. For formula input,MatrixModels::model.Matrix()is called to construct matrix input that is then used as the A-matrix for fixed effects, one per column, added up to form the combined effect. - Documentation and examples improvements
Bug fixes
- Fix A-matrix construction for
evaluate_model()for cases where theinla_fargument matters - More efficient and robust mesh integration code
- Cleanup of environment handling for component lists
inlabru 2.4.0
CRAN release: 2021-12-19
Features
- Allow predictors to have different size than the input data. The
dataargument is now allowed to be alist(), and the new argumentresponse_dataallows separate specification of component inputs and response variables. - Add
bru_mapper_collectclass for handling sequential collections of mappers, including collections where all but the first mapper is hidden from theINLA::f()argumentsnandvalues, as needed to support e.g. “bym2” models. - Add
control.familyas a direct argument tolike(). Gives a warning if acontrol.familyargument is supplied to the theoptionsargument ofbru(), but at least one likelihood hascontrol.familyinformation. (Issue #109)
Bugfixes
- Fix support for
SpatialPointsDataFrameandSpatialGridDataFrameinput tobru_fill_missing() - Force explicit
model = "offset"components instead of special options, to avoid interfering with the linearisation system (Issue #123) - Make the iterations more robust by resetting the internal INLA predictor states to initial value zero at each step
Miscellaneous
- Rename the option
bru_method$stop_at_max_rel_deviationtobru_method$rel_tol. Automatic conversion to the new name, but a warning is given. - Add option
bru_method$max_stepto control the largest allowed line search scaling factor. See?bru_options - New default option
bru_compress_cpset toTRUEto compress the predictor expression forfamily="cp"to use a single element for the linear predictor sum.
inlabru 2.3.1
CRAN release: 2021-03-22
- Documentation and dependency updates for CRAN compatibility
- See NEWS for version 2.3.0 for the major updates since version 2.1.13
inlabru 2.3.0
CRAN release: 2021-03-16
Breaking changes since version 2.1.13
- The model component argument
maphas been deprecated. Usemainto specify the main component input,~ elev(main = elevation, model = "rw2"). Unlike the oldmapargument,mainis the first one, so the shorter version~ elev(elevation, model = "rw2")also works. - Intercept-like components should now have explicit inputs, e.g.
~ Intercept(1)to avoid accidental confusion with other variables. - The argument list for
bru()has been simplified, so that all arguments exceptcomponentsandoptionsmust either be outputs from calls tolike(), or arguments that can be sent to a singlelike()call. - The option setting system has been replaced with a more coherent system; see
?bru_options()for details. - The
samplersanddomainsystem forlgcpmodels is now stricter, and requires explicitdomaindefinitions for all the point process dimensions. Alternatively, user-defined integration schemes can be supplied via theipsargument.
New features since version 2.1.13
- The model component input arguments
main,group,replicate, andweightscan now take general R expressions using the data inputs. Special cases are detected:SpatialPixels/GridDataFrameobjects are evaluated at spatial locations if the input data is aSpatialPointsDataFrameobject. Functions are evaluated on the data object, e.g.field(coordinates, model = spde) - The component arguments
mapper,group_mapper, andreplicate_mappercan be used for precise control of the mapping between inputs and latent variables. See?bru_mapperfor more details. Mapper information is automatically extracted fromINLA::inla.spde2.pcmatern()model objects. - The R-INLA
weightsandcopyfeatures are now supported. - The predictor expressions can access the data object directly via
.data. - If data from several rows can affect the same output row, the
allow_combine = TRUEargument must be supplied tolike() - The
includeandexcludearguments tolike(),generate(), andpredict()can be used to specify which components are used for a given likelihood model or predictor expression. This can be used to prevent evaluation of components that are invalid for a likelihood or predictor. - Predictor expressions can access the latent state of a model component directly, by adding the suffix
_latentto the component name, e.g.name_latent. Forlike(), this requiresallow_latent = TRUEto activate the needed linearisation code for this. - Predictor expressions can evaluate component effects for arbitrary inputs by adding the suffix
_evalto access special evaluator functions, e.g.name_eval(1:10). This is useful for evaluating the 1D effect of spatial covariates. See the NEWS item for version 2.2.8 for further details. - The internal system for predictor linearisation and iterated INLA inference has been rewritten to be faster and more robust
- See the NEWS entries for versions 2.1.14 to 2.2.8 for further details on new features and bug fixes
inlabru 2.2.8
-
Add
_evalsuffix feature forgenerate.bruandpredict.bru, that provides a general evaluator function for each component, allowing evaluation of e.g. nonlinear effects of spatial covariates as a function of the covariate value instead of the by the spatial evaluator used in the component definition. For example, withcomponents = ~ covar(spatial_grid_df, model = "rw1"), the prediction expression can have~ covar_eval(covariate), wherecovariateis a data column in the prediction data object.For components with
groupandreplicatefeatures, these also need to be provided to the_evalfunction, with..._eval(..., group = ..., replicate = ...)This feature is built on top of the
_latentsuffix feature, that gives direct access to the latent state variables of a component, so in order to use_evalin the model predictor itself, you must uselike(..., allow_latent = TRUE)in the model definition.
inlabru 2.2.7
- Add support for
ngroupandnrepin component definitions - Updated
mexdolphinandmrseadata sets, with consistent km units and improved mesh designs
inlabru 2.2.6
- Add
predict(..., include)discussion to distance sampling vignette, for handling non-spatial prediction in spatial models. - Fix bugs in
gg.SpatialLines
inlabru 2.2.5
- Vignette corrections
- Documentation improvements
- Fix minor bug in
Spatial*object handling and plotting
inlabru 2.2.4
- Properly extract the joint latent conditional mode instead of the marginal latent conditional mode
inlabru 2.2.2
- Fixed issue with
predict()logic for converting output toSpatial*DataFrame - Use
control.mode=list(restart=FALSE)in the final inla run for nonlinear models, to avoid an unnecessary optimisation. - Fix issues in
pixels()andbru_fill_missing()forSpatial*DataFrameobjects withncol=0data frame parts.
inlabru 2.2.0
- Support for the INLA “copy” feature,
comp2(input, copy = "comp1") - Allow component weights to be an unnamed parameter,
comp(input, weights, ...) - Direct access to the data objects in component inputs and predictor expressions, as
.data., allowing e.g.covar(fun(.data.), ...)for a complex covariate extractor methodfun() - Partial support for spherical manifold meshes
- Uses INLA integration strategy “eb” for initial nonlinear iterations, and a specified integration strategy only for the final iteration, so that the computations are faster, and uses the conditional latent mode as linearisation point.
inlabru 2.1.15
- New options system
- New faster linearisation method
- New line search method to make the nonlinear inla iterations robust
- Method for updating old stored estimation objects
- System for supplying mappings between latent models and evaluated effects via
bru_mapperobjects - Improved factor support; Either as “contrast with the 1st level”, via the special
"factor_contrast"model, or all levels with model"factor_full". Further options planned (e.g. a simpler options to fix the precision parameter). The estimated coefficients appear as random effects in theinla()output. - Interface restructuring to support new features while keeping most backwards compatibility. Change
map=tomain=or unnamed first argument; Sincemainis the first parameter, it doesn’t need to be a named argument. - Keep components with zero derivative in the linearisation
- PROJ6 support
- Add random seed option for posterior sampling
- Add package unit testing
- New backend code to make extended feature support easier
- New
int.argsoption to control spatial integration resolution, thanks to Martin Jullum (martinju)
inlabru 2.1.12
CRAN release: 2019-06-24
- Workaround an integration points error for old (ca pre-2018) INLA versions
inlabru 2.1.7
- Added a
NEWS.mdfile to track changes to the package. - Added
inlamethods forpredict()andgenerate()that convertinlaoutput intobruobjects before calling thebruprediction and posterior sample generator. - Added protection for examples requiring optional packages
- Fix
sample.lgcpoutput formatting, extended CRS support, and more efficient sampling algorithm - Avoid dense matrices for effect mapping
inlabru 2.1.4
-
iinla()tracks convergence of both fixed and random effects