[Biomod-commits] Biomod-commits Digest, Vol 34, Issue 28

Andreas Soteriades andreassot10 at yahoo.com
Tue Feb 28 19:25:16 CET 2012


Hi Wilfried,

Here's my code:

library(BIOMOD)
bradypus<- read.csv("bradypus_swd.csv", header=TRUE)
background<- read.csv("background.csv", header=TRUE)
names(bradypus)[2]<-paste("x")
names(bradypus)[3]<-paste("y")
presence_absence<- matrix(nrow = (nrow(bradypus) + nrow(background)), ncol = 1)
for (i in 1:nrow(bradypus)) {presence_absence[i,1]<- 1}
for (i in (nrow(bradypus)+1):nrow(presence_absence)) {presence_absence[i,1]<- 0}
colnames(presence_absence)<- c("Sp1")
Sp.Env<- rbind(bradypus, background)
Sp.Env<- cbind(Sp.Env, presence_absence)
Sp.Env$ecoreg = as.factor(Sp.Env$ecoreg)
Resp.Var<- Sp.Env[,18]
Resp.Var<- as.data.frame(Resp.Var)
Expl.Var <- Sp.Env[,4:17]
LatLong<- Sp.Env[, 2:3]
head(Sp.Env, 10)
summary(Sp.Env)
Initial.State(Response = Resp.Var, Explanatory = Expl.Var)

>>Perhaps you could copy paste the Initial.State call you made

See above

>>The first ten lines of your observed data (head(MyDate). 

 x                  y   cld6190_ann  dtr6190_ann  ecoreg

 1  -65.4000 -10.3833                   76                104    10
2   -65.3833 -10.3833                   76                 104     10
3   -65.1333 -16.8000                   57                 114     10
4   -63.6667 -17.4500                   57                 112     10
5   -63.8500 -17.4000                   57                 113     10
6   -64.4167-16.0000                   58                 111     10
7   -63.1667 -17.8000                   57                 110       8
8   -56.7333    -2.6000                   77                   82     10
9   -59.1333    -3.7000                   83                  86      10
10 -60.0833   -3.1333                  82                   85      10

frs6190_ann h_dem  pre6190_ann  pre6190_l10  pre6190_l1  pre6190_l4  pre6190_l7
1              2       121                  46                   41                84                54                   3
2              2       121                  46                   40                84                54                   3
3              1       211                  65                   56              129                58                 34
4              3       363                  36                   33                71                27                 13
5              3       303                  39                   35                77                29                 15
6              0       166                  54                   48              107                45                 23
7              0       430                  33                   30                61               29                  15
8              0        12                   60                   24                69               96                  42
9              0        23                   58                   30                96               95                  25
10            0        32                   62                   39                84               98                  29

  tmn6190_ann  tmp6190_ann  tmx6190_ann  vap6190_ann  Sp1
1          192         266         337         279   1
2          192         266         337         279   1
3          140         244        321         221   1
4          135         229         307         202   1
5          134         229         306        202   1
6          156         252         326         235   1
7          153         245         326         217   1
8          229         275         335         306   1
9          220         271         328         301   1
10         224         272         328         300   1

>>summary( MyData)
>>I doubt there are in the good format.

 x                y            cld6190_ann   
Min.   :-94.72   Min.   :-55.025   Min.   :32.00  
1st Qu.:-69.92   1st Qu.:-24.538   1st Qu.:54.00  
Median :-62.98   Median :-11.825   Median :64.00  
Mean   :-62.05   Mean   :-13.560   Mean   :63.15  
3rd Qu.:-54.12   3rd Qu.: -2.425   3rd Qu.:74.00  
Max.   :-34.92   Max.   : 23.125   Max.   :84.00  
                                                                               
  dtr6190_ann        ecoreg      frs6190_ann         h_dem     
 Min.   : 49.0   10     :4590   Min.   :  0.00   Min.   :   0  
 1st Qu.: 98.0   9      :1781   1st Qu.:  0.00   1st Qu.: 101  
 Median :110.0   5      :1232   Median :  1.00   Median : 249  
 Mean   :112.4   8      : 790   Mean   : 21.04   Mean   : 579  
 3rd Qu.:125.0   2      : 620   3rd Qu.: 11.00   3rd Qu.: 598  
 Max.   :178.0   12     : 495   Max.   :235.00   Max.   :5610  
                 (Other): 608                                  
  pre6190_ann      pre6190_l10       pre6190_l1       pre6190_l4    
 Min.   :  0.00   Min.   :  0.00   Min.   :  0.00   Min.   :  0.00  
 1st Qu.: 23.00   1st Qu.: 16.00   1st Qu.: 23.00   1st Qu.: 21.00  
 Median : 41.00   Median : 37.00   Median : 47.00   Median : 38.00  
 Mean   : 41.43   Mean   : 38.96   Mean   : 50.99   Mean   : 46.93  
 3rd Qu.: 58.00   3rd Qu.: 55.00   3rd Qu.: 81.00   3rd Qu.: 73.00  
 Max.   :204.00   Max.   :250.00   Max.   :185.00   Max.   :188.00  
                                                                    
   pre6190_l7      tmn6190_ann      tmp6190_ann     tmx6190_ann   
 Min.   :  0.00   Min.   :-110.0   Min.   :  1.0   Min.   :101.0  
 1st Qu.:  4.00   1st Qu.:  74.0   1st Qu.:183.0   1st Qu.:296.0  
 Median : 14.00   Median : 159.0   Median :246.0   Median :320.0  
 Mean   : 29.75   Mean   : 128.3   Mean   :214.9   Mean   :301.6  
 3rd Qu.: 45.00   3rd Qu.: 196.0   3rd Qu.:261.0   3rd Qu.:331.0  
 Max.   :222.00   Max.   : 229.0   Max.   :282.0   Max.   :362.0  
                                                                  
  vap6190_ann         Sp1         
 Min.   :  1.0   Min.   :0.00000  
 1st Qu.:155.0   1st Qu.:0.00000  
 Median :225.0   Median :0.00000  
 Mean   :205.3   Mean   :0.01147  
 3rd Qu.:269.0   3rd Qu.:0.00000  
 Max.   :310.0   Max.   :1.00000 
>If you also fear this is because of the categorical variable, try without it.

But since some models in BIOMOD can handle categorical variables, then would it be wise to exclude it? Doesn't that alter the results?

> First of all, does someone have to go through the whole procedure of typing the code above for each model >and for each variable, and to use the predict() function each time? According to the tutorial ?once the models >are trained (i.e. calibrated), a standard prediction is made. Then, one of the variables is randomized and a >new prediction is made.? I thought that BIOMOD was following this procedure automatically. If yes, how? If >not, how can I load CTA, ANN (and all the rest of the models in general) the same way glm is loaded in the >code above (i.e. glm(Sp281 ~ Var1 + Var2 + Var3 + Var4 + Var5 + Var6 + Var7, data=Sp.Env))?

>>Obviously not, or I will not have spent ten years coding BIOMOD?

Ok, but this unfairly ironic reply does not answer my question: what should I do instead of following the procedure described above? You might have spent ten years coding BIOMOD but how much time have you actually spent writing the manuals? I am afraid they are quite badly written! I first tried to learn BIOMOD a year ago by reading the 2008 manuals; I struggled for 2-3 weeks before giving up. I switched to WEKA and learned how to operate the software through the command line in one day by using the manual, even though I had never programmed in Java before. Three weeks ago I downloaded MaxEnt together with the manual and it just took me some days to learn how to analyse the outputs, not to mention that it was a piece of cake to run the models.

BIOMOD is such a powerful and innovative tool, and I have always found very exciting the idea of mastering it so as to have a series of different models running my predictions silmuntaneously. I truly believe that it is much better than MaxEnt and WEKA. I have been following your scientific work since the day I found out about BIOMOD but I still haven't managed to make it work properly. The 2012 manual is as bad as those of 2008... 

There is only one simple thing I'm asking for: if you aren't really willing to upgrade the manuals, then can I please ask you to be more supportive in the mailing list? I have received incomplete answers in the past as well and that does not help neither the users nor you.

Cheers,

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/biomod-commits/attachments/20120228/16fe0a3f/attachment-0001.html>


More information about the Biomod-commits mailing list