geo.fit: Function to fit a either a spatial or spatio-temporal model...

Description Usage Arguments Value

View source: R/geo_fit.r

Description

Function to fit a either a spatial or spatio-temporal model to geo-statistical data with an intercept and covariates

Usage

1
2
3
4
5
6
7
geo.fit(mesh = NULL, locs = NULL, response = NULL, temp = NULL,
  covariates = NULL, family = "gaussian", control.time = list(model =
  "ar1", param = list(theta = list(prior = "pccor1", param = c(0, 0.9)))),
  control.inla = list(strategy = "gaussian", int.strategy = "eb"),
  control.compute = list(dic = TRUE, waic = TRUE, cpo = TRUE, config = TRUE),
  non.linear = NULL, prediction = NULL, sig0 = 1, Psig = 0.5,
  rho0 = 0.3, Prho = 0.5, verbose = FALSE, ...)

Arguments

mesh

a “mesh” object i.e. delauney triangulation of the domain, an object returned by make.mesh.

locs

a matrix of observation locations, where each row corresponds to the observation.

response

a vector of response variable, each corresponds to the spatial locations in locs.

temp

(optional) a numeric vector specifying a temporal index for each observation (starting at 1.....T).

covariates

(optional) a named data.frame of covariates.

family

a character vector specifying the assumed likelihood of the response, by default is "gaussian".

control.time

(optional) supplied if the temp argumet is given to fit a spatio-temporal model. This argument controls the model and prior put on the hyperparameters of the model for the temporal component of the spatio-temporal model. By default this is list(model = 'ar1', param = list(theta = list(prior='pccor1', param = c(0, 0.9)))) which is a pc.prior put on the rho coefficient of a AR(1) model with P(rho>0)=0.9. Refer to Simpson, martins, and rue for further details *****put in proper refs*****

control.inla

a list which controls the fitting procedures INLA uses see Rue et al. ***ref book*** by default this is list(strategy='gaussian',int.strategy = 'eb') for quick and dirty fitting.

control.compute

a list of fit statistics the user wants INLA to return. By default this is list(dic = TRUE, waic = TRUE,cpo = TRUE, config = TRUE).

non.linear

(optional) should be used if the user requires a non-linear covariate to be included in the model Must be supplied as a named list with elements random.effect a numeric vector of the random effect indecies, and model the random effect model the user wishes to use for random.effect

prediction

(optional) should be used if the uses wnts to run a prediction model. Must be supplied as a named list with pred.locs the locations where predictionas are to be made, and only if a spatio-tempral model is to be fitted pred.temp the temporal indecies for the predictions (the same length as pred.locs).

sig0

by default = 1, typical standard deviation to use pc priors for hyperparams of spde model

Psig

by default = 0.5 prob for sigma of pc prior

rho0

by default = 0.3, typical range to use pc priors for hyperparams of spde model

Prho

by default = 0.5 prob for rho of pc prior

verbose

Logical if TRUE model fit is output to screen.

...

add inla options to speed up computation i.e., by giving starting values from a previos model

Value

A inla result object


cmjt/lgcpSPDE documentation built on July 25, 2019, 3:05 p.m.