Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: error in models projections [ Reply ]
By: Mafalda Gama on 2014-05-12 14:00
Thank you so much!!!!it worked out perfectly!!!

RE: error in models projections [ Reply ]
By: Wilfried Thuiller on 2014-05-12 06:42
Hi Mafalda,
This is very simple. Just make sure your future bioclimatic variables have the same names than the ones you calibrated the models with.

During your calibration phase, they are called: bio5_1, bio5_10.

In your future data, they are called bio10, bio12... There is no underscore. Biomod does not recognized the variables. Make sure to also have the same variables. it seems you used bio1 during the calibration but it is not in the future data.

Finally, I would strongly suggest to remove altitude from both the calibration and future conditions. It varies with temp and precip. However, when temp and precip are gonna vary over time (climate change), altitude will not. This variable is meaningless when considering projections over space or time.

Hope it helps,

error in models projections [ Reply ]
By: Mafalda Gama on 2014-05-09 10:30
Hello I am quite new in biomod2 but following the tutorials i've managed to do my own modeling without major issues........but now that I want to project using future bioclimatic variables it gives me an error....I've read that when I close and re open my data I should load some of the models again so that the program can do the projections correctly....and i've done that but i keep getting the error....should I only load the bioclimatic variables??(because other such as altitude or slope do not vary???) or the problem is with the location where the new files are saved???(in diferent files on my harddrive).....also i had to resample 2 variables,may be the problem that???I will post below the code I'm using and the error...

Can anyone help me???
Thank you in advance for your time!!!
Mafalda Gama
(PhD student at Coimbra University, portugal)

> # load biomod2 package
> library(biomod2)
Loading required package: sp
Loading required package: raster
Loading required package: parallel

biomod2 first load...
custom help index setting up...
custom vignettes files setting up...Customed index built!
biomod2 3.1-25 loaded.

Type browseVignettes(package='biomod2') to access directly biomod2 vignettes.
> load("CorbiculaBIO5NewVariables.RData")
> myBiomodData

-=-=-=-=-=-=-=-=-=-=-=-=-= '' -=-=-=-=-=-=-=-=-=-=-=-=-= = Corbicula

406 presences, 0 true absences and 298 undifined points in dataset

11 explanatory variables

bio5_1 bio5_10 bio5_11 bio5_12
Min. :-97.0 Min. : 33.0 Min. :-353.00 Min. : 0.0
1st Qu.: 97.0 1st Qu.:185.0 1st Qu.: 7.00 1st Qu.: 515.0
Median :143.0 Median :218.0 Median : 57.00 Median : 758.0
Mean :140.7 Mean :216.6 Mean : 60.55 Mean : 867.3
3rd Qu.:191.2 3rd Qu.:250.0 3rd Qu.: 119.00 3rd Qu.:1117.5
Max. :300.0 Max. :366.0 Max. : 270.00 Max. :3571.0
bio5_5 bio5_6 bio5_8 bio5_9
Min. : 72.0 Min. :-422.000 Min. :-89.0 Min. :-302.0
1st Qu.:250.0 1st Qu.: -44.000 1st Qu.:116.0 1st Qu.: 24.0
Median :289.0 Median : 19.000 Median :165.5 Median : 154.0
Mean :285.4 Mean : 3.842 Mean :167.7 Mean : 114.3
3rd Qu.:321.0 3rd Qu.: 69.000 3rd Qu.:228.0 3rd Qu.: 218.0
Max. :478.0 Max. : 228.000 Max. :365.0 Max. : 341.0
alt5 slopewgs ctinorm
Min. : -50.0 Min. : 0.000449 Min. :-1.436e-05
1st Qu.: 83.0 1st Qu.: 0.342314 1st Qu.: 1.278e-07
Median : 178.0 Median : 0.885616 Median : 5.439e-07
Mean : 377.3 Mean : 1.467667 Mean : 7.848e-07
3rd Qu.: 432.2 3rd Qu.: 1.816291 3rd Qu.: 1.374e-06
Max. :4542.0 Max. :17.715365 Max. : 1.219e-05

2 Pseudo Absences dataset available ( PA1 PA2 ) with 147
absences in each (true abs + pseudo abs)

> myBiomodModelOut

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= BIOMOD.models.out -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Modeling id :

Species modeled : Corbicula

Considered variables : bio5_1 bio5_10 bio5_11 bio5_12 bio5_5 bio5_6 bio5_8
bio5_9 alt5 slopewgs ctinorm

Computed Models : Corbicula_PA1_RUN1_SRE Corbicula_PA1_RUN1_CTA
Corbicula_PA1_RUN1_RF Corbicula_PA1_RUN1_MARS Corbicula_PA1_RUN1_FDA
Corbicula_PA1_RUN1_GLM Corbicula_PA1_RUN1_GBM Corbicula_PA1_RUN1_GAM
Corbicula_PA1_RUN1_ANN Corbicula_PA1_Full_SRE Corbicula_PA1_Full_CTA
Corbicula_PA1_Full_RF Corbicula_PA1_Full_MARS Corbicula_PA1_Full_FDA
Corbicula_PA1_Full_GLM Corbicula_PA1_Full_GBM Corbicula_PA1_Full_GAM
Corbicula_PA1_Full_ANN Corbicula_PA2_RUN1_SRE Corbicula_PA2_RUN1_CTA
Corbicula_PA2_RUN1_RF Corbicula_PA2_RUN1_MARS Corbicula_PA2_RUN1_FDA
Corbicula_PA2_RUN1_GLM Corbicula_PA2_RUN1_GBM Corbicula_PA2_RUN1_GAM
Corbicula_PA2_RUN1_ANN Corbicula_PA2_Full_SRE Corbicula_PA2_Full_CTA
Corbicula_PA2_Full_RF Corbicula_PA2_Full_MARS Corbicula_PA2_Full_FDA
Corbicula_PA2_Full_GLM Corbicula_PA2_Full_GBM Corbicula_PA2_Full_GAM

Failed Models : none

> myBiomodEM

-=-=-=-=-=-=-=-=-=-=-=-= 'BIOMOD.EnsembleModeling.out' -=-=-=-=-=-=-=-=-=-=-=-= : Corbicula

expl.var.names : bio5_1 bio5_10 bio5_11 bio5_12 bio5_5 bio5_6 bio5_8 bio5_9
alt5 slopewgs ctinorm

models computed:
Corbicula_TotalConsensus_TSS_EMmean, Corbicula_TotalConsensus_TSS_EMcv, Corbicula_TotalConsensus_TSS_EMciInf, Corbicula_TotalConsensus_TSS_EMciSup, Corbicula_TotalConsensus_TSS_EMmedian, Corbicula_TotalConsensus_TSS_EMca, Corbicula_TotalConsensus_TSS_EMwmean


> library(raster)
> bio1 = raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_1.asc")
rgdal: version: 0.8-16, (SVN revision 498)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.10.1, released 2013/08/26
Path to GDAL shared files: C:/Users/Mafalda/Documents/R/R-3.0.3/library/rgdal/gdal
GDAL does not use iconv for recoding strings.
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
Path to PROJ.4 shared files: C:/Users/Mafalda/Documents/R/R-3.0.3/library/rgdal/proj
> bio10 = raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_10.asc")
> bio11 = raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_11.asc")
> bio12 = raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_12.asc")
> bio5= raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_5.asc")
> bio6 = raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_6.asc")
> bio8 = raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_8.asc")
> bio9 = raster("C:\\Users\\Mafalda\\Desktop\\bio5total\\futuroDados\\ip26_9.asc")
> alt = raster("C:\\Users\\Mafalda\\Documents\\bio_5m_esri\\alt5.asc")
> slope= raster("C:\\Users\\Mafalda\\Documents\\bio_5m_esri\\slopewgs.asc")
> slopeR <-resample(slope, bio1, method='bilinear')
> cti = raster("C:\\Users\\Mafalda\\Desktop\\Biomod2\\STRM\\ctiNORM.asc")
> ctiR <-resample(cti, bio1, method='bilinear')
> worldclim=stack(bio1, bio10, bio11, bio12, bio5, bio6, bio8, bio9, alt, slopeR, ctiR)

> myExpl2050=worldclim
> myBiomodProjFuture <- BIOMOD_Projection( modeling.output = myBiomodModelOut,
+ new.env = myExpl2050,
+ = 'future',
+ selected.models = 'all',
+ binary.meth = 'TSS',
+ compress = 'xz',
+ clamping.mask = T,
+ output.format = '.grd')

-=-=-=-=-=-=-=-=-=-=-=-=-=-= Do Models Projections -=-=-=-=-=-=-=-=-=-=-=-=-=-=
Error in .BIOMOD_Projection.check.args(modeling.output, new.env,, :
'new.env' layer names don't match with explanatory variables used for buiding models

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