Description Usage Arguments Details Value Examples
View source: R/INLAMRAfunctions.R
Fits the INLA-MRA model to a spatiotemporal dataset.
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
)
|
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. |
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.
A list with three components:
hyperMarginalMoments A data.frame giving the mean, and standard deviation of the marginal log-hyperparameter posteriors, as well as their 95% credible intervals. Note that the scaling of the time hyperparameters depends on the provided time values. If they are inputted as POSIX* objects, time hyperparameters will relate to time measured in days. If they are inputted as numeric, the original scale is used instead.
FEmarginalMoments A data.frame giving the mean and standard deviation of the marginal fixed effects posteriors, as well as their 95% credibility intervals.
predMoments A data.frame with two columns, Mean and SD. The order of the predictions matches the one in predCovariateFrame.
1 2 3 4 | ## Not run:
# See example in vignette.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.