rSPDE (development version)
- Added
type_rational_approximation = "wl2", a new way of obtaining the rational coefficients. The classes are parameterised so that every fit is a valid model and have no constant term, so the covariance-based models haveminstead ofm + 1latent blocks. Available inmatern.operators()andCBrSPDE.matern.operators()for bothtype = "covariance"andtype = "operator", inmatern.rational()andmatern.rational.cov()for the exact one-dimensional models, and directly throughrational.coefficients.wl2(). It requiresfloor(nu + d/2)to be 0, 1 or 2 for the covariance type, that isnu < 3 - d/2, andnu + d/2 < 2for the operator type. The existing"brasil","chebfun"and"chebfunLB"types are unchanged and remain the default. -
spde.matern.operators()acceptstype_rational_approximation = "wl2"for bothtype = "covariance"andtype = "operator". The coefficients depend onalphaand the dimension only, not on the varyingkappaandtau, so the same ones serve the non-stationary model; the blocks carry the shift in the same way as the stationary ones. - Fixed: the non-stationary covariance-based model (
spde.matern.operators()withtype = "covariance") joined its blocks outside the loop over the poles, so the precision had three blocks whatever the order. Format least 3 the model was silently the wrong one, missing the poles 2 tom-1. - Fixed:
spde.matern.operators()withtype = "operator"did not passtype_rational_approximationon, so every type gave the same model. -
type = "operator"now accepts only two of the four rational types. Its factorisation has a single table of roots, produced by the chebfun lower-bound method, so"chebfunLB"selects that table and"wl2"fits its own;"brasil"and"chebfun"are refused rather than quietly given roots they did not produce, and remain available fortype = "covariance". Leavingtype_rational_approximationat its default is unaffected. The tabulated roots are stored format most 4, while"wl2"fits them at any order. The operator-based models have no INLA interface;rspde.matern()is covariance-based throughout. -
rspde.matern1d()acceptstype.rational.approx = "wl2", for a fixednuand for an estimated one. The exact one-dimensional model then hasrspde.orderblocks offloor(alpha) + 1entries per location instead of that plus a k-block, and the pole blocks carry the shared shift. -
rspde.matern()acceptstype.rational.approx = "wl2", for a fixednuand for an estimated one, withrspde.orderat least 1. The latent field then hasrspde.orderblocks instead ofrspde.order + 1, whichrspde.make.A()andrspde.make.index()follow through their newtype.rational.approxargument. - The mesh-free weighted-L2 coefficients are stored in the package, as the tabulated ones are, for
d= 1 to 3,m= 1 to 6 andfloor(alpha)= 0, 1 and 2. They depend on neither the mesh norkappaand are what a covariance-based model uses by default, so the common case fits nothing at set-up.data-raw/wl2_tables.Rregenerates them, and the tests check that a fresh fit still reproduces what is stored. - Added
rspde.xmin(), which computes the lower end of the spectral interval from the mesh and a lower bound forkappa, and the argumentsx_minandkappa_reftomatern.operators(). Fitting on that shorter interval is appreciably more accurate than the mesh-free fit, and is done when the model is created.update_rational_coefficients()recomputes the coefficients oncekappahas been estimated. - Added
rspde.wl2.table(), which builds a weighted-L2 table for a given spectral interval, and thewl2_tableargument ofmatern.operators(), which takes one and overridesx_minandkappa_ref. A table built for another dimension, order or range ofalphais refused rather than used. - Added
rspde.cache(), which keeps generated coefficient tables between sessions, undertools::R_user_dir("rSPDE", "cache")or a directory of your choosing. It is off by default, since a package should not write outside the session temporary directory unless asked; the environment variableRSPDE_CACHE_DIRsets it for non-interactive use. Lookup is automatic, and a table fitted on a slightly wider spectral interval is reused, since it still covers the whole spectrum. - Added
variance_correction = "nodal"tomatern.operators(), which addsmax(sigma^2 - diag(Sigma), 0)to the diagonal of the covariance of a"wl2"covariance-based model. What this corrects is mostly the finite element discretisation rather than the rational approximation. It is off by default, as it depends on the parameters it cannot be tabulated, so it is meant for a model whose parameters are already estimated. - The package now has compiled code in every install, CRAN included:
src/wl2_fit.cppholds the inner loop of the weighted-L2 fit. The INLAcgenericsources remain optional and are still built only withRSPDE_COMPILE=1or--configure-args='--enable-compiled'. The equivalent R implementation is kept as the reference and is used whenoptions(rSPDE.wl2.use.cpp = FALSE). - The
RSpectradependency is gone.rspde.xmin(eigenvalue = "exact")and the scaling of the intrinsic models now use Lanczos iterations in the package. Both are also more robust, and the intrinsic one is faster than the old method. -
intrinsic.operators()now honours itsoptsargument, which was built and then replaced by a hardcoded list. Its entries aretolandmaxitr, as before. - Fixed
matern.rational.cov(), which evaluated the covariance at the lagsh[1] - h, rather than ath. A matrix of lags is now also accepted, and returns a matrix. -
get.roots()now uses spline interpolation by default. Linear interpolation lost accuracy off the 200-node beta grid of the tables (symbol error 1.6e-4 instead of 1.8e-6 at beta = 0.875, m = 4). - Fixed the inlabru mapper for
rspde.spacetime()models whose spatial mesh is ametric_graph.bru_get_mapper()usedbm_fmesher()for the graph, which has nofm_dof()method, sobru()failed with “invalid subscript type ‘list’”. - The optional cgeneric
Makefilenow only uses Homebrewgcc-14on macOS and the compilers R was configured with elsewhere, so compiled installs (RSPDE_COMPILE=1) work on Linux. -
posterior_crossvalidation()is now an S3 generic, with methods forrspde_lmefits and for lists of fitted models. MetricGraph provides thegraph_lmemethod, so the two packages no longer mask each other’s function, and a list can mixrspde_lmeandgraph_lmefits.
rSPDE 2.6.0
CRAN release: 2026-08-31
- Added
posterior_crossvalidation()for objects fitted withrspde_lme(). The function mirrors the interface ofMetricGraph::posterior_crossvalidation. - Added
hybrid.spde(), a new hybrid Whittle-Matern SPDE model with a non-zero deterministic mean. - Added
rspde.hybrid.matern(), a INLA cgeneric model for the hybrid Whittle-Matern SPDE with alpha = 2. - Added a
kappa_muoption that lets the operator applied to the mean use a different range parameter from the one in the covariance. Default (kappa_mu = NULLinhybrid.spde(),separate_kappa_mu = FALSEinrspde.hybrid.matern()) keeps them linked. When enabled,kappa_muis estimated jointly inrspde_lmeand INLA, or can be held fixed viamodel_options$fix_kappa_mu. - The INLA cgeneric models now use the rSPDE models built into INLA when they are available, falling back to the local rSPDE shared library otherwise.
shared_libalso accepts a path to a shared library file. - Added
rspde_safe_inla()andlocal_rspde_safe_inla(), which check that a usable INLA installation is available, for use in examples and tests. -
rspde.metric_graph()now passesshared_libon torspde.matern(), and its default is now"detect", matching the other INLA models. - Updated the inlabru interface to the inlabru 2.14 API. rSPDE now requires
fmesher (>= 0.7.0)and suggestsinlabru (>= 2.14.0). -
predict.rspde_lme()can reuse precomputed parameter-dependent quantities, which speeds up repeated predictions such as in cross-validation. - Fixed
predict.rspde_lme()for models with replicates: the same location in different replicates no longer triggers a duplicated-locations warning. - Fixed
update()for non-stationary models, where newthetavalues were ignored, so predictions from non-stationaryrspde_lme()fits used stale parameters. -
spde.matern.operators()no longer converts a model to a stationary one whenB.tauorB.kappavary in space. - Added a vignette comparing rSPDE with the exact Matern covariance in terms of timing and memory.
rSPDE 2.5.2
CRAN release: 2026-01-26
- Added intrinsic Matern mapper support and related documentation.
- Added
covariance_mesh,cov_function_mesh, andmake_Adocumentation. - Improved intrinsic and fractional operator implementations and stability.
- Updated INLA/inlabru interfaces and examples.
- Expanded unit tests and vignette updates (spacetime/anisotropic/intrinsic).
rSPDE 2.5.1
CRAN release: 2025-03-21
- Added
model_optionsargument torspde_lme()function, which allows users to set starting values for different parameters and also to fix parameters during estimation. - Added
previous_fitargument torspde_lme(), which allows users to provide a previously fitted model as input to obtain starting values for a new fit.
rSPDE 2.5.0
- Improved the
cross_validationfunction to allow for multiple likelihoods. - General adjusts on
rspde.intrinsicfor stability. - inlabru implementation for
rspde.intrinsic. - Improved warning messages when calling inla-related functions.
- Added
wCRPSandswCRPSscores oncross_validation.
rSPDE 2.4.0
CRAN release: 2024-12-02
- Created the
group_predictfunction, to obtain predictions on a testing set based on observations on a training set. - Added support for
stochvol,stochvol.nig,stochvollnandbinomiallikelihoods incross_validationfunction. - Changing the default
nu.upper.boundto 2 in dimension 1, and keeping the defaultnu.upper.boundto 4 in dimension 2 inrspde.matern()function. - Created
matern.rational()operators for creating stationary matern operators. - Created
spacetime.operators()for creating space-time models. - Created
matern2d.operators()for anisotropic operators. - Implemented space-time operators in cgeneric to be used in
INLAandinlabru. - Implemented anisotropic operators in cgeneric to be used in
INLAandinlabru. - Implemented stationary operators in cgeneric to be used in
INLAandinlabru. - Added vignette on space-time models.
- Added vignette on stationary models.
- Added vignette on anisotropic models.
rSPDE 2.3.3
CRAN release: 2023-11-05
- Bugfix on rspde_lme when fitting with fixed smoothness.
- Added a 2d fem interface.
- Moved from using INLA’s mesh functions to fmesher’s mesh functions.
- Removing rgdal from suggests.
- The
dataargument inpredict.rspde_lmehas been changed tonewdata. - Adding
covariance_meshandcov_function_meshmethods as functions in the list returned by objects obtained frommatern.operators()andspde.matern.operators(). - Updated the internal structure to match the updates from the
MetricGraphpackage. - Updated the
cross_validationfunction to match the updates ininlabru. - Added
glanceandaugmentmethods forrspde_lmeobjects.
rSPDE 2.3.2
CRAN release: 2023-07-02
- Small improvement on speed for rspde_lme.
- Bugfix on Q for small values of nu in dimension 1.
- Adding parameterization option for rspde.result.
- Bugfix on which_repl in rspde_lme.
- Addressing issues related to the new version of the Matrix package.
rSPDE 2.3.1
CRAN release: 2023-05-25
- Adding references in DESCRIPTION.
- Changing link to eigen library.
rSPDE 2.3.0
- Fixed a bug on rSPDE.construct.matern.loglike when the parameterization is “matern”.
- Created the rspde_lme() interface, with corresponding standard methods(predict, summary, etc).
- Updated the vignettes to use the rspde_lme() interface instead of the likelihood function factory.
- Replaced chol by Cholesky when using it to compute determinants or to solve systems.
rSPDE 2.2.0
CRAN release: 2023-04-12
- Adding a new parameterization (variance and a range-like parameter)
- Posterior sampling on the predict method.
- Added the
cross_validationfunction which has several scoring rules implemented (MSE, CRPS, SCRPS, DSS) based on ourinlabruimplementation of the rational SPDE approach.
rSPDE 2.1.0
CRAN release: 2023-01-19
- Expanded the parameterization options on matern.operators and spde.matern.operators, along with their associated functions.
- Implementation of the precision method for inla_rspde objects.
- Implementation of the covariance-based spde.matern.operators function and its associated functions.
- Adjusts on the compatibility with the forthcoming MetricGraph package.
rSPDE 2.0.0
- Added cgeneric versions of the nonstationary models
- Added support for metric graphs (depends on the MetricGraph package)
- Added cgeneric versions of the stationary models
- Replaced rgeneric models by their cgeneric counterparts
- Added a new parameterization (range and std. dev)
- Created a new method gg_df to help posterior plotting in ggplot2
rSPDE 1.2.0
CRAN release: 2022-09-16
- Added an inlabru interface
- Added “rational.order” and “rational.type” functions
- Added the BRASIL rational approximation
- Improved covariance-based operator objects
- Improved log-likelihood computation
- Created 2d folded Matern under different boundary conditions
- Implemented different boundary conditions for 1d folded Matern
rSPDE 1.1.0
- Minor typos on vignettes and man pages were corrected
- Some examples were changed to improve their numerical stability
rSPDE 1.0.0
CRAN release: 2021-12-13
- Implementation of the covariance-based rational approximation for stationary Matérn models
- R-INLA implementation of the rational SPDE approach
- Added an introduction to rSPDE vignette
- The previous vignette was updated an became an operator-based rational approximation vignette
- Added a vignette for the R-INLA implementation of the SPDE approach
- Added a vignette to present the rational approximation using the rSPDE package
- Backward compatibility was maintained
