This function is depreciated. Please use one of startISDM
or startSpecies
.
intModel(
...,
spatialCovariates = NULL,
Coordinates,
Projection,
Mesh,
IPS = NULL,
Boundary = NULL,
speciesSpatial = "copy",
speciesIndependent = FALSE,
markNames = NULL,
markFamily = NULL,
pointCovariates = NULL,
pointsIntercept = TRUE,
marksIntercept = TRUE,
speciesEffects = list(randomIntercept = FALSE, Environmental = TRUE),
Offset = NULL,
pointsSpatial = "copy",
marksSpatial = TRUE,
responseCounts = "counts",
responsePA = "present",
trialsPA = NULL,
trialsMarks = NULL,
speciesName = NULL,
temporalName = NULL,
temporalModel = list(model = "ar1"),
copyModel = list(beta = list(fixed = FALSE)),
Formulas = list(covariateFormula = NULL, biasFormula = NULL)
)
A specifyISDM
object (class R6
). Use ?specifyISDM
to get a comprehensive description of the slot functions associated with this object.
The datasets to be used in the model. May come as either sf
, data.frame
or SpatialPoints*
objects, or as a list of objects with these classes. The classes of the datasets do not necessarily need to be standardized, however the variable names within them often have to be.
The spatial covariates used in the model. These covariates must be measured at every location (pixel) in the study area, and must be a Raster*
, SpatialPixelsDataFrame
or SpatialRaster
object. Can be either numeric
, factor
or character
data.
A vector of length 2 containing the names (class character
) of the coordinate variables used in the model.
The coordinate reference system used by both the spatial points and spatial covariates. Must be of class character
.
An inla.mesh
object required for the spatial random fields and the integration points in the model (see inla.mesh.2d
from the INLA package for more details).
The integration points to be used in the model (that is, the points on the map where the intensity of the model is calculated). See fm_int
from the inlabru package for more details regarding these points; however defaults to NULL
which will create integration points from the Mesh
object.
A sf
object of the study area. If not missing, this object is used to help create the integration points.
Argument to specify if each species should have their own spatial effect with different hyperparameters to be estimated using INLA's "replicate" feature, of if a the field's should be estimated per species copied across datasets using INLA's "copy" feature. Possible values include: 'replicate'
, 'copy'
, 'shared'
or NULL
if no species-specific spatial effects should be estimated.
Logical argument: Should species effects be made independent of one another. Defaults to FALSE
which creates effects for each species independently.
A vector with the mark names (class character
) to be included in the integrated model. Marks are variables which are used to describe the individual points in the model (for example, in the field of ecology the size of the species or its feeding type could be considered). Defaults to NULL
, however if this argument is non-NULL
, the model run will become a marked point process. The marks must be included in the same data object as the points.
A vector with the statistical families (class character
) assumed for the marks. Must be the same length as markNames, and the position of the mark in the vector markName
is associated with the position of the family in markFamily
. Defaults to NULL
which assigns each mark as "Gaussian".
The non-spatial covariates to be included in the integrated model (for example, in the field of ecology the distance to the nearest road or time spent sampling could be considered). These covariates must be included in the same data object as the points.
Logical argument: should the points be modeled with intercepts. Defaults to TRUE
. Note that if this argument is non-NULL
and pointsIntercepts
is missing, pointsIntercepts
will be set to FALSE
.
Logical argument: should the marks be modeled with intercepts. Defaults to TRUE
.
List specifying if intercept terms and environments effects should be made for the species. Defaults to list(randomIntercept = FALSE, Environmental = TRUE)
. randomIntercept
may take on three values: TRUE
which creates a random intercept for each species, FALSE
which creates fixed intercepts for each species, of NULL
which removes all species level intercepts. Note that if randomIntercept = NULL
and pointsIntercept = TRUE
, dataset specific intercept terms will be created.
Name of the offset variable (class character
) in the datasets. Defaults to NULL
; if the argument is non-NULL
, the variable name needs to be standardized across datasets (but does not need to be included in all datasets). The offset variable will be transformed onto the log-scale in the integrated model.
Argument to determine whether the spatial field is shared between the datasets, or if each dataset has its own unique spatial field. The datasets may share a spatial field with INLA's "copy" feature if the argument is set to copy
. May take on the values: "shared"
, "individual"
, "copy"
, "correlation"
or NULL
if no spatial field is required for the model. Defaults to "copy"
.
Logical argument: should the marks have their own spatial field. Defaults to TRUE
.
Name of the response variable in the counts/abundance datasets. This variable name needs to be standardized across all counts datasets used in the integrated model. Defaults to 'counts'
.
Name of the response variable (class character
) in the presence absence/detection non-detection datasets. This variable name needs to be standardized across all present absence datasets. Defaults to 'present'
.
Name of the trials response variable (class character
) for the presence absence datasets. Defaults to NULL
.
Name of the trials response variable (class character
) for the binomial marks (if included). Defaults to NULL
.
Name of the species variable name (class character
). Specifying this argument turns the model into a stacked species distribution model, and calculates covariate values for the individual species, as well as a species group model in the shared spatial field. Defaults to NULL
. Note that if this argument is non-NULL
and pointsIntercepts
is missing, pointsIntercepts
will be set to FALSE
.
Name of the temporal variable (class character
) in the model. This variable is required to be in all the datasets. Defaults to NULL
.
List of model specifications given to the control.group argument in the time effect component. Defaults to list(model = 'ar1')
; see control.group
from the INLA package for more details.
List of model specifications given to the hyper parameters for the "copy"
model. Defaults to list(beta = list(fixed = FALSE))
.
A named list with two objects. The first one, covariateFormula
, is a formula for the covariates and their transformations for the distribution part of the model. Defaults to NULL
which includes all covariates specified in spatialCovariates
into the model. The second, biasFormula
, specifies which covariates are used for the PO datasets. Defaults to NULL
which includes no covariates for the PO datasets.
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set base model up
baseModel <- intModel(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, responsePA = 'Present')
#Print summary
baseModel
#Set up model with dataset specific spatial fields
indSpat <- intModel(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, pointsSpatial = 'individual', responsePA = 'Present')
#Model with offset variable
offSet <- intModel(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, Offset = 'area', responsePA = 'Present')
#Assume area as a mark
markModel <- intModel(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, markNames = 'area', markFamily = 'gamma',
responsePA = 'Present')
}
Run the code above in your browser using DataLab