fit.multi: function to fit model used in bird paper

Description Usage Arguments Value

View source: R/fit_multi.r

Description

function to fit model used in bird paper

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fit.multi(locs = NULL, mesh = NULL, temp = NULL, binary.response = NULL,
  density.response = NULL, family = rep(c("binomial", "gamma"), 3),
  hyper = list(intra = list(beta_1 = list(theta = list(prior = "normal", param
  = c(0, 10))), beta_2 = list(theta = list(prior = "normal", param = c(0, 10))),
  beta_3 = list(theta = list(prior = "normal", param = c(0, 10)))), inter =
  list(beta_z3 = list(theta = list(prior = "normal", param = c(0, 10))),
  gamma_z3 = list(theta = list(prior = "normal", param = c(0, 10))), beta_y3 =
  list(theta = list(prior = "normal", param = c(0, 10))), gamma_y3 = list(theta
  = list(prior = "normal", param = c(0, 10))))), 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),
  spde.new.params = NULL, verbose = FALSE, link = NULL, ...)

Arguments

locs

BTO GBFS site locations

mesh

Delauney triangulation of the UK (see Lindgren, Finn, Håvard Rue, and Johan Lindström. 2011.)

temp

years of GBFS

binary.response

list of length three. each referring to presence = 1, absence = 0 of the bird species sparrowhawk, collared dove, house sparrow respectively

density.response

list of length three. each referring to non-zero density of the bird species sparrowhawk, collared dove, house sparrow respectively.

family

a character vector of length two specifying the assumed likelihood of each species' response, by default is rep(c("binomial","gamma"),3).

hyper

a list (of length 2) of lists of priors for each copy parameter. The first list has length 3 specifying the priors on the intra species interaction parameters ( c(beta_1, beta_2, beta_3) i.e., sparrowhawk, collared dove, house sparrow resp.). the second element is of length 4 specifying the priors on the inter species interaction parameters in order these refer to the parameters beta_z3, gamma_z3, beta_y3, and gamma_y3 (see model definition). By default each is a N(0,10) (i.e., list(theta=list(prior='normal', param=c(0,10))))

control.time

(optional) supplied if the temp argument 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 (see Blangiardo, Marta, Michela Cameletti, Gianluca Baio, and Håvard Rue. 2013.).

control.inla

a list which controls the fitting procedures INLA uses 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).

spde.new.params

by default this is NULL. If supplied must be a named list with components: sig0 - typical standard deviation to use pc priors for hyperparams of spde model, Psig - prob for sigma of pc prior, rho0 - typical range to use pc priors for hyperparams of spde model, and Prho - 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 previous model

Value

A inla result object (see ue, Håvard, Sara Martino, and Nicolas Chopin. 2009.)


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