compute.brt: Compute BRT (Boosted Regression Trees) model

Description Usage Arguments Details Value Note References See Also Examples

Description

Compute species distribution models with Boosted Regression Trees

Usage

1
2
compute.brt(x, proj.predictors, tc = 2, lr = 0.001, bf = 0.75,
           n.trees = 50, step.size = n.trees)

Arguments

x

SDMtab object or dataframe that contains id, longitude, latitude and values of environmental descriptors at corresponding locations

proj.predictors

RasterStack of environmental descriptors on which the model will be projected

tc

Integer. Tree complexity. Sets the complexity of individual trees

lr

Learning rate. Sets the weight applied to individual trees

bf

Bag fraction. Sets the proportion of observations used in selecting variables

n.trees

Number of initial trees to fit. Set at 50 by default

step.size

Number of trees to add at each cycle

Details

The function realizes a BRT model according to the gbm.step function provided by Elith et al.(2008). See the publication for further information about setting decisions.
The map produced provides species presence probability on the projected area.

Value

A list of 4

Note

See Barbet Massin et al. (2012) for information about background selection to implement BRT models

References

Barbet Massin M, F Jiguet, C Albert & W Thuiller (2012) Selecting pseudo absences for species distribution models: how, where and how many? Methods in Ecology and Evolution, 3(2): 327-338.

Elith J, J Leathwick & T Hastie (2008) A working guide to boosted regression trees. Journal of Animal Ecology, 77(4): 802-813.

See Also

gbm.step

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## Not run: 
#Download the presence data
data('ctenocidaris.nutrix')
occ <- ctenocidaris.nutrix
# select longitude and latitude coordinates among all the information
occ <- ctenocidaris.nutrix[,c('decimal.Longitude','decimal.Latitude')]

#Download the environmental predictors restricted on geographical extent and depth (-1500m)
envi <- raster::stack(system.file('extdata', 'pred.grd',package='SDMPlay'))
envi

#Open SDMtab matrix
x <- system.file(file='extdata/SDMdata1500.csv',package='SDMPlay')
SDMdata <- read.table(x,header=TRUE, sep=';')

#Run the model
model <- SDMPlay:::compute.brt (x=SDMdata, proj.predictors=envi,lr=0.0005)

#Plot the partial dependance plots
dismo::gbm.plot(model$response)

#Get the contribution of each variable for the model
model$response$contributions

#Get the interaction between variables
dismo::gbm.interactions(model$response)
#Plot the interactions
int <- dismo::gbm.interactions(model$response)
# choose the interaction to plot
dismo::gbm.perspec(model$response,int$rank.list[1,1],int$rank.list[1,3])

#Plot the map prediction
library(grDevices) # add nice colors
palet.col <- colorRampPalette(c('deepskyblue','green','yellow', 'red'))( 80 )
raster::plot(model$raster.prediction, col=palet.col)
#add data
points(occ, col='black',pch=16)


# SECOND EXAMPLE: projecting the model on another period
# Remark: to predict on a different RasterStack, the rasterlayer names of the two
# stacks must be the same and the number of layers must be the same as well.
# Changes have been done in this example by attributing similar names to pred
# and pred2000 stacks and adding extra blank layers (NA layers) to pred2000 stack.
envi2000 <- raster::stack(system.file('extdata', 'pred2000.grd',package='SDMPlay'))

#Run the model
model2 <- SDMPlay:::compute.brt (x=SDMdata, proj.predictors=envi2000,lr=0.0005)

#Plot the new predicting map
raster::plot(model2$raster.prediction, col=palet.col)
#add data
points(occ, col='black',pch=16)
## End(Not run)

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