INLAMRA: INLA-MRA model for inference and prediction in spatiotemporal...

Description Usage Arguments Details Value Examples

View source: R/INLAMRAfunctions.R

Description

Fits the INLA-MRA model to a spatiotemporal dataset.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
INLAMRA(
  responseVec,
  covariateFrame = NULL,
  spatialCoordMat,
  timePOSIXorNumericVec,
  predCovariateFrame = NULL,
  predSpatialCoordMat = NULL,
  predTimePOSIXorNumericVec = NULL,
  sinusoidalProjection = FALSE,
  spatialRangeList = NULL,
  spatialSmoothnessList = list(start = log(1.5)),
  timeRangeList = NULL,
  timeSmoothnessList = list(start = log(0.5)),
  scaleList = list(start = 0, hyperpars = c(mu = 0, sigma = 2)),
  errorSDlist = list(start = 0),
  fixedEffSDlist = list(start = log(10)),
  FEmuVec = rep(0, ncol(covariateFrame) + 1),
  control = NULL
)

Arguments

responseVec

A numeric vector with response values.

covariateFrame

A data.frame containing covariate values in the order of elements in responseVec. Character elements should be re-coded as factors.

spatialCoordMat

A matrix or data.frame with two columns with the first corresponding to longitude, and the second to latitude; can also be x and y if the sinusoidal projection is used.

timePOSIXorNumericVec

A vector of time values, preferrably in POSIX* format. Can also be in numeric format.

predCovariateFrame

A data.frame containing covariate values for the prediction datasets.

predSpatialCoordMat

Like spatialCoordMat, but for the prediction data.

predTimePOSIXorNumericVec

Like timePOSIXorNumericVec, but for prediction data.

sinusoidalProjection

Logical value indicating whether the provided coordinates are in the sinusoidal projection.

spatialRangeList

List with two elements: a starting value for the spatial range log-hyperparameter, and a two element vector giving the mean and standard deviation of the normal hyperprior (second element must be omitted if hyperparameter is fixed).

spatialSmoothnessList

List with two elements: a starting value for the spatial smoothness log-hyperparameter, and a length-two vector giving the mean and standard deviation of the associated normal hyperprior (second element must be omitted if hyperparameter is fixed.

timeRangeList

List with two elements: a starting value for the temporal range log-hyperparameter, and a length-two vector giving the mean and standard deviation of the associated normal hyperprior (second element must be omitted if hyperparameter is fixed).

timeSmoothnessList

List with two elements: a starting value for the temporal smoothness log-hyperparameter, and a length-two vector giving the mean and standard deviation of the associated normal hyperprior (second element must be omitted if hyperparameter is fixed).

scaleList

List with two elements: a starting value for the scale log-hyperparameter, and a length-two vector giving the mean and standard deviation of the associated normal hyperprior (second element must be omitted if hyperparameter is fixed)

errorSDlist

List with two elements: a starting value for the uncorrelated error standard deviation log-hyperparameter, and a length-two vector giving the mean and standard deviation of the associated normal hyperprior (second element must be omitted if hyperparameter is fixed).

fixedEffSDlist

List with two elements: a starting value for the uncorrelated fixed effects standard deviation log-hyperparameter, and a length-two vector giving the mean and standard deviation of the associated normal hyperprior (second element must be omitted if hyperparameter is fixed).

FEmuVec

Vector with the mean value of the priors for the fixed effects. Its length must be equal to the number of columns in covariateFrame plus one (for the intercept).

control

List of control parameters. See ?INLAMRA.control.

Details

Spatial coordinates must use the longitude/latitude ("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0") or sinusoidal ("+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +R=6371007.181 +units=m +no_defs") projection. In the latter case, they will be automatically converted to the lon./lat. projection.

Some of the control parameters should be tuned to ensure better computational or predictive performance, or to make it possible to stop and resume model fitting. See INLAMRA.control.

Value

A list with three components:

Examples

1
2
3
4
## Not run: 
# See example in vignette.

## End(Not run)

villandre/MRAinla documentation built on April 20, 2021, 7:49 a.m.