null.model: Compute null model

Description Usage Arguments Details Value Note See Also Examples

Description

Compute null model. Null models are useful tools to enhance a priori due to occurrence spatial structuration in species distribution predictions (e.g. non homogeneous sampling).
Null model 'type 1' performs a model by randomly sampling data in a matrix that provides the visited longitudes and latitudes. Model null type #1 highlights extra information about prior influences of sampling effort on models.

Null model type #2 samples data in the entire study area, and reflects what should be predicted if occurrences were randomly distributed in the area.

Null models are a compilation of nb.rep models. Species distribution models can be compared to density distribution of the null model outputs in order to estimate signification rates.

Usage

1
2
3
null.model(predictors, xy = NULL, type = c(1, 2), algorithm = c("brt", "maxent"), nb,
         unique.data = T, same = T, background.nb = nb, nb.rep = 10, tc = 2,
         lr = 0.001, bf = 0.75, n.trees = 50, step.size = n.trees)

Arguments

predictors

Rasterstack object that contains the predictors that will be used for species distribution models

xy

Dataframe that contains the longitude and latitude of the visited pixels. Information required to perform type 1 null model. Default= NULL

type

Null model type to perform. type=1 to perform a null model based on visited areas, type=2 to predict random model

algorithm

Algorithm to compute the null model. 'brt' or 'maxent'

nb

Number of points to randomly sample (among the matrix of visited pixels for 'type=1' model or in the entire geographic space for 'type=2')

unique.data

If TRUE (default), pixel duplicates contained in 'xy' are removed

same

If TRUE (default), the number of background data sampled in the area will be 'nb'

background.nb

Number of background data to sample. If this argument is filled, 'same' is set FALSE.

nb.rep

Null models number of replicates. See compute.brt

tc

BRT parameter. Integer. Tree complexity. Sets the complexity of individual trees. See compute.brt

lr

BRT parameter.Learning rate. Sets the weight applied to individual trees. See compute.brt

bf

BRT parameter.Bag fraction. Sets the proportion of observations used in selecting variables. See compute.brt

n.trees

BRT parameter.Number of initial trees to fit. Set at 50 by default. See compute.brt

step.size

BRT parameter.Number of trees to add at each cycle. See compute.brt

Details

Data are sampled without replacement. Each time the model is runned, new data (presence-like and background data) are sampled

Value

List of 6

Note

Increasing the number of replications will enhance model null relevance (we advice nb.rep=100 for minimum). Please note that processing may take few minutes to hours.

If you want to build a MaxEnt model, compute.maxent uses the functionalities of the maxent function. This function uses MaxEnt species distribution software, which is a java program that could be downloaded at http://www.cs.princeton.edu/~schapire/maxent/. In order to run compute.maxent, put the 'maxent.jar' file downloaded at this adress in the 'java' folder of the dismo package (path obtained with the system.file('java', package='dismo') command). MaxEnt 3.3.3b version or higher is required.

See Also

nicheOverlap: compare prediction maps .jpackage: initialize dismo for Java

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Not run: 
library(dismo)
#Download the environmental predictors restricted on geographical extent and depth (-1500m)
envi <-raster::stack(system.file('extdata', 'pred.grd',package='SDMPlay'))

# Realize a null model type #2 with BRT
#--------------------------------------
# NB: the following arguments chosen for the example are not relevant,
# in the scope to minimize running time
modelN2 <- SDMPlay:::null.model(xy=NULL,predictors=envi,type=2,algorithm='brt',
                     nb=300,unique.data=TRUE, same=TRUE, nb.rep=2,lr=0.005)

# Look at the inputs used to implement the model
modelN2$input

# Get the evaluation of the models produced
modelN2$eval

# Get the evaluation of the mean of all these produced models (i.e. evaluation
# of the null model )
modelN2$eval.null

# Get the values of Spearman correlations between the all the prediction maps produced
modelN2$correlation

# Plot the mean null model map with nice colors
library(grDevices)
palet.col <- colorRampPalette(c('deepskyblue','green','yellow', 'red'))(80)
raster::plot(modelN2$pred.mean, col=palet.col)

## End(Not run)

charleneguillaumot/SDMPlay documentation built on May 13, 2019, 3:30 p.m.