SCM

Forum: biomod2 package is now available !

Posted by: damien georges
Date: 2012-07-26 13:56
Summary: biomod2 package is now available !
Project: BioMod

Content:

Dear BIOMOD-users,

You were eagerly waiting for it, and we are happy to say that the new version of BIOMOD called biomod2 is now online on R-Forge.

Although we kept the same modelling philosophy than the former version (which we will still maintain for a while), we have made crucial changes. biomod2 is now fully object-oriented and made for running on a single species only (see vignette MultiSpeciesModelling for multi-species modelling at once). For advanced BIOMOD users, the new functions might be a bit disturbing at the beginning. Then, you will see that this new version is much more advanced and practical than the former ones. Among the novelties, the addition of MAXENT in the modelling techniques, a large range of evaluation metrics, a more refined definition of ensemble modelling and ensemble forecasting, the possibility to give presence-only data and environmental rasters to biomod2 and let it extract pseudo-absence data directly.

We have created several vignettes for you to get use to this new version and a figure explaining the different ways of giving data to BIOMOD.

Please bear in mind that R-Forge is a development platform, it means that this new package would experience repeated updating the next couple of weeks (correcting bugs, adding documentation, adding functionalities) so think about updating the package before each new study you will do.

Last but not least, all comments are welcome! If you find a bug, if you think some documentation points are unclear, if you think about new functionalities that may be useful, just let us know ASAP.

We count on you to help finalizing this new version to a very nice tool. We will then release it to CRAN by the end of July. Please remember to add your code, R-version, OS and BIOMOD-version every time you report a bug or a mistake in the vignette or help files.

Hoping you will enjoy this new version of BIOMOD.

With our best wishes,

Damien & Wilfried

Latest News

biomod2 is now devel on github

damien georges - 2020-03-02 17:08 -

biomod2 package is now available !

damien georges - 2012-07-26 13:56 -
...

 

Monitor Forum | Start New Thread Start New Thread
RE: Warning message about convergence after running GAM model [ Reply ]
By: damien georges on 2020-06-19 13:53
[forum:47866]
Hi,

I think the best test is to go until projection step and make a deep visual inspection of the species distribution in current condition. I also advise you to compare GAM with other models prediction. If everithing is coherent then you can keep going.

Cheers,
Damien

Warning message about convergence after running GAM model [ Reply ]
By: Floor Maters on 2020-05-11 15:48
[forum:47855]
Dear Damien and Wilfried,

I am using biomod2 for my master thesis for predicting several cetacean distributions and get a warning message when trying to run my GAM model:

In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully

When I looked up this warning I found this link (unrelated to biomod2 but related to GAM and the same error): https://github.com/ToonVanDaele/trias-test/issues/8

From this link I would say the error has something to do with poor data, which may be right as I don't have many sightings . I am using 5 environmental predictor layers, when removing or adding predictor layers I still get the warning. I only have presence points and increasing or decreasing the amount of pseudo absences does not remove the warning either.

My question: do you have any idea whether I can ignore this warning or any suggestions on what to do? Ignoring the warning feels weird, but I also don't know what to change anymore.

Thank you!

Best,
Floor


------------------------------------------------------------------
###################################################
### 1: loading_data

# load the library
library(biomod2)

# extra libraries
library(raster)
library(rgdal)
library(maptools)
library(dismo)
library(ggplot2)

# load our species data
DataSpecies <- read.csv(path2sp,sep=';',fileEncoding="UTF-8-BOM")
# Check species data
head(DataSpecies)
#plot species data
qplot(x=x,y=y,colour=Spinner,data=DataSpecies)


# the name of studied species
myRespName <- 'Spinner'

# the presence/absences data for our species
myResp <- as.numeric(DataSpecies[,myRespName])
myResp

# the XY coordinates of species data
myRespXY <- DataSpecies[,c("x","y")]
# check coordinates
str(myRespXY)
head(myRespXY)

layers<-stack(list.files(path=path2layers,pattern='asc',full.names=TRUE ))
# Check layers structure
print(layers)
# Plot layers
plot(layers)
# Descriptive statistics for environmental layers
summary(layers)
# Select variables to include in the model
names(layers)
myExpl<-layers[[c("bathymetry","chla_annual","d_coast_ls","slope","sss_annual")]]

# Check layers structure
print(myExpl)
# Plot environmental variables on geographical space
plot(myExpl)


###################################################
### 2: formating_data

myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
expl.var = myExpl,
resp.xy = myRespXY,
resp.name = myRespName
)

# print_formating_data
myBiomodData

#: plot_formating_data
plot(myBiomodData)


###################################################
### 3: modeling_options

# Defining Models Options using default options
# Consult help
?BIOMOD_ModelingOptions
myBiomodOption <- BIOMOD_ModelingOptions()

# Setting working directory
setwd(path2work)

###################################################
### 4: modeling

# Computing the models
# See help
?BIOMOD_Modeling
myBiomodModelOut <- (BIOMOD_Modeling(
myBiomodData, # data including species records, species name, and variables
models = c('GAM'), # modelling methods
models.options = myBiomodOption, # options for modelling
NbRunEval=10, # number of Evaluation run
DataSplit=70, # % of data used as training
Prevalence = 0.5,
VarImport=1, # number of permutation to estimate var importance
models.eval.meth = c('TSS','ROC'), # evaluation metrics
#SaveObj = TRUE, # keep all results and outputs on hard drive
#rescal.all.models = TRUE, # all models scaled with a binomial GLM: the range of the scale is 0-1000
do.full.models = TRUE, # models calibrated and evaluated with the whole dataset
modeling.id = "allmodels")) # ID (=name) of modeling procedure


Output:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Spinner Modeling Summary -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

5 environmental variables ( bathymetry chla_annual d_coast_ls slope sss_annual )
Number of evaluation repetitions : 11
Models selected : GAM

Total number of model runs : 11

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


-=-=-=- Run : Spinner_AllData


-=-=-=--=-=-=- Spinner_AllData_RUN1

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN2

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN3

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN4

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN5

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN6

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN7

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN8

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN9

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_RUN10

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...


-=-=-=--=-=-=- Spinner_AllData_Full

Model=GAM
GAM_mgcv algorithm chosen
Automatic formula generation...
> GAM (mgcv) modelling...
Evaluating Model stuff...
Evaluating Predictor Contributions...

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Warning messages:
1: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
2: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
3: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
4: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
5: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
6: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
7: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
8: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
9: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully

Thanks to:
Vienna University of Economics and Business Powered By FusionForge