uniSpace: Univariate spatial model

Description Usage Arguments Details Value

View source: R/uniSpace.R

Description

Spatial model for presence-absence data using INLA. This function is essentially a specialized wrapper over inla

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
uniSpace(
  formula,
  sPoints,
  explanaMesh,
  offset = NULL,
  family = NULL,
  link = NULL,
  smooth = 2,
  prior.range = c(0.05, 0.01),
  prior.sigma = c(1, 0.01),
  ...
)

Arguments

formula

A formula that relates the response and some (or all) of the explanatory variables X. The name of the response variable is the name of the variable in sPoints.

sPoints

A SpatialPointsDataFrame with the response variable.

explanaMesh

An object of class explanaMesh

offset

A character string defining the explanatory variable in explanaMesh$X to use as offset.

family

A character string describing the error distribution to be used when constructing the model.

link

A character string describing the link function to be used when constructing the model.

smooth

A single value ranging between 0 and 2 passed to inla.spde2.pcmatern. It defines the smoothness of the Matern SPDE model. Default is set at 2.

prior.range

A vector of length 2, with (range0, Prange) specifying that P(ρ < ρ_0) = p_ρ, where ρ is the spatial range of the random field. If Prange is NA, then range0 is used as a fixed range value. Default is c(0.05, 0.01).

prior.sigma

A vector of length 2, with (sigma0, Psigma) specifying that P(σ > σ_0) = p_σ, where σ is the marginal standard deviation of the field. If Psigma is NA, then sigma0 is used as a fixed range value. Default is c(1, 0.01).

...

Arguments passed to inla

Details

The underlying model used by this function is a generalized spatial linear model using the cloglog link function. The idea to use the cloglog link function instead of another link function (e.g. logit or probit) is that it is more flexible.

Value

An object of class uniSpace that includes a model output, which is the model output of INLA.

In addition, it includes a series of attributes:

formula

The formula used to construct the model

sPoints

A SpatialPointDataFrame object that includes the sample location and associated data of the modelled species.

XEst

A matrix with all the explanatory variables used to construct the model. If there were factors in the original set of explanatory variables X, in XEst, they were decomposed into dummy variables. The values in XEst are the one from the sampled location.

XPred

A matrix with all the explanatory variables used to construct the model. If there were factors in the original set of explanatory variables X, in XPred, they were decomposed into dummy variables. The values in XPred were gathered at the mesh edges.

mesh

An object of class inla.mesh. It is the mesh used to construct the model.

Stack

An object of class inla.data.stack. It is a stack object constructed internally.


ReseauBiodiversiteQuebec/mapSpecies documentation built on Dec. 18, 2021, 9:57 a.m.