This is probably just a small bug, I'm not sure it really affects the summary output. When I run summary() on a model fitted with bru() and an inla.spde2.pcmatern model component, I see the following error at the bottom of the output:
Error in if (eff$model == "spde2") { : argument is of length zero
Here is a reproducible example:
require(gamair) # has aral sea chlorophyll data
data(aral)
data(aral.bnd)
library(inlabru)
library(INLA)
# Mesh stuff
bnd <- inla.mesh.segment(cbind(aral.bnd$lon, aral.bnd$lat))
loc <- cbind(aral$lon, aral$lat)
mesh <- inla.mesh.2d(boundary=bnd,
max.edge=c(0.384, 0.5),
min.angle=c(30, 21),
max.n=c(48000, 16000), ## Safeguard against large meshes.
max.n.strict=c(128000, 128000), ## Don't build a huge mesh!
cutoff=0.01, ## Filter away adjacent points.
offset=c(0.1, 0.3)) ## Offset for extra boundaries, if needed.
# spde model
spde <- inla.spde2.pcmatern(mesh=mesh,
prior.range=c(0.1, 0.5),
prior.sigma=c(10, 0.5))
# fit model
formula <- chl ~ Intercept + grf(main = c("lon", "lat"), model=spde)
fit = bru(formula,
family = "gaussian",
data = aral)
# summary of model
summary(fit)
Which outputs the following summary
> summary(fit)
--- Likelihoods ----------------------------------------------------------------------------------
--- Criteria -------------------------------------------------------------------------------------
Watanabe-Akaike information criterion (WAIC): 2.524e+03
Deviance Information Criterion (DIC): 2.524e+03
--- Fixed effects --------------------------------------------------------------------------------
mean sd 0.025quant 0.5quant 0.975quant mode signif
Intercept 7.126369 0.1476909 6.836283 7.126366 7.416199 7.12637 TRUE
--- Random effects -------------------------------------------------------------------------------
grf ranges: mean = [-0.015573, -0.00279093], sd = [9.81306, 22.1313], quantiles = [-50.3478 : 50.3715]
--- All hyper parameters (internal representation) -----------------------------------------------
mean sd 0.025quant 0.5quant
Precision for the Gaussian observations 0.09475057 0.006080073 0.08323349 0.09460216
Range for grf 0.22504556 0.423184487 0.02203839 0.11058469
Stdev for grf 13.29680729 13.050600539 0.89893700 9.44926520
0.975quant mode
Precision for the Gaussian observations 0.1071693 0.09436951
Range for grf 1.1318961 0.04708621
Stdev for grf 48.1460019 2.45499929
Error in if (eff$model == "spde2") { : argument is of length zero`
This is probably just a small bug, I'm not sure it really affects the summary output. When I run
summary()
on a model fitted withbru()
and aninla.spde2.pcmatern
model component, I see the following error at the bottom of the output:Error in if (eff$model == "spde2") { : argument is of length zero
Here is a reproducible example:
Which outputs the following summary
My session info is