[Biomod-commits] GAM error

Damien Georges damien.georges2 at gmail.com
Fri Oct 26 14:47:33 CEST 2012


Dear Maria,

GAM algorithm is really memory consuming. Here, it seems to require more 
memory than your computer has.

Moreover, due to model implementation, GAM is not able to work with more 
than 19 variables. (I mention it even if it's not your case here)

Because I had exactly the same troubles some days ago (and because I 
don't like step models selection so much), I decide to add the gam 
models from mgcv library to biomod2 (version 2.1.0 on R-Forge since 2 
days). So you are now able to chose either "GAM_mgcv" (default, mgcv 
package), "GAM_gam" (gam package) or "BAM_mgcv" (mgcv package, for big 
Dataset) by changing the arg algo from GAM in BIOMOD_ModelingOptions 
(see ?BIOMOD_ModelingOptions).
Maybe the BAM_mgcv is appropriated in your case even if it will be time 
consuming.

If your lack of memory issue is still there, you will have 3 choices :
- remove GAM modelling
- remove some variables (are you sure that all are useful for modelling? 
don't you have variables really correlated one to another?)
- resticted your modeling area (pseudo absences, pixels aggregation...)


Hoping that helps,

Best,

Damien.





On 26/10/2012 14:15, Maria Guerrina wrote:
> Hi all,
> we have a problem with bioclimatic variables and GAM.
> If we use more 16 variables in GAM, we have error below.
> If we use less 16 variables in GAM, we haven't error
> If we use more 16 variables excluding GAM, we haven't error.
> We extendend memory limits, since at limit of pc (4GB).
> Is it possible using GAM model only on pc with more of 4GB memory?
>
> Thank you all
> Maria Guerrina
> PhD Student
> Università di Genova
> DISTAV
> Corso Dogali 1M
> I - 16136 GENOVA (Italy
>
>
> ERROR
> -=-=-=- esa Modeling Summary
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 19 environmental variables ( layer.1 layer.2 layer.3 layer.4 layer.5 layer.6
> layer.7 layer.8 layer.9 layer.10 layer.11 layer.12 layer.13 layer.14 layer.15
> layer.16 layer.17 layer.18 layer.19 )
> Number of evaluation repetitions : 2
> Models selected : GAM
> Total number of model runs : 2
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
> -=-=-=- Run : esa_PA1
>
>
> -=-=-=--=-=-=- esa_PA1_RUN1
>
> Model=GAM spline
> 2 Degrees of smoothingError : cannot allocate vector of size 4.3 Gb
> Inoltre: Warning messages:
> 1: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
> 2: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
> 3: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
> 4: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
>
> ! Note : esa_PA1_RUN1_GAM failed!
>
>
> -=-=-=--=-=-=- esa_PA1_Full
>
> Model=GAM spline
> 2 Degrees of smoothingError : cannot allocate vector of size 4.3 Gb
> Inoltre: Warning messages:
> 1: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
> 2: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
> 3: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
> 4: In array(FALSE, term.lengths) :
> Reached total allocation of 3958Mb: see help(memory.size)
>
> ! Note : esa_PA1_Full_GAM failed!
> Errore in checkSlotAssignment(object, name, value) :
> assignment of an object of class “NULL” is not valid for slot "val" in an object
> of class “BIOMOD.stored.array”; is(value, "array") is not TRUE
>
> Maria Guerrina
> PhD Student
> Università di Genova
> DISTAV
> Corso Dogali 1M
> I - 16136 GENOVA (Italy)
> _______________________________________________
> Biomod-commits mailing list
> Biomod-commits at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits



More information about the Biomod-commits mailing list