fusion.dinla: Fit a spatial fusion model using INLA

View source: R/fusionINLA.R

fusion.dinlaR Documentation

Fit a spatial fusion model using INLA

Description

Fit a spatial fusion model using INLA based on the unifying framework proposed by Wang and Furrer (2021). One or more latent Gaussian process(es) is assumed to be associated with the spatial response variables.

Usage

## S3 method for class 'dinla'
fusion(data, n.latent = 1, bans = 0, pp.offset,
    verbose = FALSE, alpha = 3/2, prior.range,
    prior.sigma, prior.args, mesh.locs, mesh.max.edge,
    mesh.args, inla.args, ...)

Arguments

data

an object of class dinla. Output of fusionData().

n.latent

integer. Number of latent processes to be modeled.

bans

either 0 or a matrix of 0s and 1s with dimension J times n.latent, where J is the total number of response variables. If matrix, 1 indicates banning an association between the latent process and response variable. If 0, no association is banned.

pp.offset

numeric, vector of numeric or matrix of numeric. Offset term for point pattern data.

verbose

logical. If TRUE, prints progress and debugging information

alpha

numeric between 0 and 2. Determines the covariance model, defined as ν + 1 for two dimensional space. Default value is 3/2 which corresponds to the exponential covariance model. See details.

prior.range

vector of length 2, with (range0, Prange) specifying that P(ρ√{8ν} < range0) = Prange, where ρ√{8ν} is the practical spatial range of the random field. If Prange is NA, then range0 is used as a fixed range value. See details.

prior.sigma

vector of length 2, with (sigma0, Psigma) specifying that P(σ > sigma0) = Psigma, where σ is the marginal standard deviation of the field. If Psigma is NA, then sigma0 is used as a fixed sigma value. See details.

prior.args

named list. Other prior arguments for inla.spde2.matern() in INLA.

mesh.locs

matrix with two columns, or a SpatialPoints, SpatialPointsDataFrame object. Locations to be used as initial triangulation nodes.

mesh.max.edge

vector of length one or two. The largest allowed triangle edge length for inner (and optional outer extension) mesh.

mesh.args

named list. Other mesh arguments passed to inla.mesh.2d() in INLA.

inla.args

named list. Other inla arguments passed to inla() INLA.

...

additional arguments not used

Details

The prior used for modeling the latent spatial processes is inla.spde2.matern. Each spatial component is named as sij, where i denotes the ith latent process and j denotes the jth variable. For example, s12 is the first latent process that is associated with the second variable. The first variable (with the following ordering: geostatistical, lattice, point pattern data) that a spatial component is associated with will have the original component, then the subsequent spatial components associated with other variables are treated as 'copies' of the original component modified by a coefficient Beta, as one of the latent parameters.

The INLA approximation only works for Matern covariance function, which can be written as

C(d) = σ^2/(2^{ν-1}Γ(ν)) * (d√{2ν}/ρ)^ν K_ν (d√{2ν}/ρ),

where d is the Euclidean distance, K_ν is a modified Bessel function, ρ is the spatial range, σ^2 is the partial sill and ν is the smoothness parameter. NOTE: the range parameter in INLA output is defined as “practical range” as ρ√{8ν}.

Value

The returned value is a list consists of

model

an object of class inla representing the fitted INLA model

mesh

an object of class inla.mesh containing the mesh used.

data

the data structure used to fit the model

Author(s)

Craig Wang

References

Wang, C., Furrer, R. and for the SNC Study Group (2021). Combining heterogeneous spatial datasets with process-based spatial fusion models: A unifying framework, Computational Statistics & Data Analysis

See Also

fusionData for preparing data, fitted for extracting fitted values, predict for prediction.

Examples

## example based on simulated data
## Not run: 
if (require("INLA", quietly = TRUE)) {
dat <- fusionSimulate(n.point = 50, n.area = 20, n.grid = 4,
               psill = 1, phi = 1, nugget = 0, tau.sq = 0.5,
               point.beta = list(rbind(1,5)),
               area.beta = list(rbind(-1, 0.5)),
               distributions = c("normal","poisson"),
               design.mat = matrix(c(1,1,1)))

geo_data <- data.frame(x = dat$mrf[dat$sample.ind, "x"],
                y = dat$mrf[dat$sample.ind, "y"],
                cov.point = dat$data$X_point[,2],
                outcome = dat$data$Y_point[[1]])
lattice_data <- sp::SpatialPolygonsDataFrame(dat$poly,
                    data.frame(outcome = dat$data$Y_area[[1]],
                    cov.area = dat$data$X_area[,2]))

dat_inla <- fusionData(geo.data = geo_data, geo.formula = outcome ~ cov.point,
                lattice.data = lattice_data, lattice.formula = outcome ~ cov.area,
                pp.data = dat$data$lgcp.coords[[1]], distributions = c("normal","poisson"),
                method = "INLA")

mod_inla <- fusion(data = dat_inla, n.latent = 1, bans = 0,
                prior.range = c(1, 0.5), prior.sigma = c(1, 0.5),
                mesh.locs = dat_inla$locs_point, mesh.max.edge = c(0.5, 1))

summary(mod_inla)
}

## End(Not run)

spatialfusion documentation built on Aug. 23, 2022, 1:05 a.m.