inla.spde.result.RdExctract field and parameter values and distributions for an
inla.spde SPDE effect from an inla result
object.
inla.spde.result(...)
# S3 method for class 'inla.spde1'
inla.spde.result(inla, name, spde, do.transform = TRUE, ...)
# S3 method for class 'inla.spde2'
inla.spde.result(inla, name, spde, do.transform = TRUE, ...)
## Direct function call for class 'inla.spde1':
inla.spde1.result(inla, name, spde, do.transform = TRUE, ...)
## Direct function call for class 'inla.spde2':
inla.spde2.result(inla, name, spde, do.transform = TRUE, ...)An inla object obtained from a call to inla
A character string with the name of the SPDE effect in the inla formula.
The inla.spde object used for the effect in the inla
formula. (Note: this could have been stored in the inla output, but
isn't.)
Usually the result of a call to inla.spde2.matern.
If TRUE, also calculate marginals transformed to user-scale.
Setting to FALSE is useful for large non-stationary models,
as transforming many marginal densities is time-consuming.
Further arguments passed to and from other methods.
For inla.spde2 models, a list, where the nominal range and
variance are defined as the values that would have been obtained with
a stationary model and no boundary effects:
Marginal densities for kappa
Marginal densities for log(kappa)
Marginal densities for log(range)
Marginal densities for log(tau)
Marginal densities for log(variance)
Marginal densities for range
Marginal densities for tau
Marginal densities for the theta parameters
Marginal densities for the field values
Marginal densities for variance
The SPDE related part of the inla hyperpar output summary
Summary statistics for log(kappa)
Summary statistics for log(range)
Summary statistics for log(tau)
Summary statistics for log(kappa)
Summary statistics for the theta parameters
Summary statistics for the field values
loc = matrix(runif(100*2),100,2)
mesh = inla.mesh.create.helper(points.domain=loc, max.edge=c(0.1,0.5))
#> Warning: error in running command
#> Error in fmesher.read(prefix, "manifold"): File '/tmp/Rtmp4ztB6d/fmesher53bd142cc5fa.manifold' does not exist.
spde = inla.spde2.matern(mesh)
#> Error: object 'mesh' not found
index = inla.spde.make.index("spatial", mesh$n, n.repl=2)
#> Error: object 'mesh' not found
spatial.A = inla.spde.make.A(mesh, loc,
index=rep(1:nrow(loc), 2),
repl=rep(1:2, each=nrow(loc)))
#> Error: object 'mesh' not found
## Toy example with no spatial correlation (range=zero)
y = 10+rnorm(100*2)
stack = inla.stack(data=list(y=y),
A=list(spatial.A),
effects=list(c(index, list(intercept=1))),
tag="tag")
#> Error: object 'spatial.A' not found
data = inla.stack.data(stack, spde=spde)
#> Error in inla.require.inherits(stack, "inla.data.stack", "'stack'"): 'stack' must inherit from class "inla.data.stack".
formula = y ~ -1 + intercept + f(spatial, model=spde,
replicate=spatial.repl)
result = inla(formula, family="gaussian", data=data,
control.predictor=list(A=inla.stack.A(stack)))
#> Error in inla(formula, family = "gaussian", data = data, control.predictor = list(A = inla.stack.A(stack))):
#> Argument `data' must be a data.frame or a list.
spde.result = inla.spde.result(result, "spatial", spde)
#> Error: object 'result' not found
plot(spde.result$marginals.range.nominal[[1]], type="l")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'spde.result' not found