<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Raquel,</div><div><br></div><div>I have no clue. It sound like the GLM experienced some problems of convergence at some point and does really manage to make a projection. I am just curious, are you sure this is an error message. Sounds more like a warning.</div><div><br></div><div>In any case, put GLM=F in projection should then work for that species. </div><div><br></div><div>Note also that such loops over species are not really memory and CPU usage efficient. I understand what you are trying to do but.... Have a look at the snowfall package which allows you to use the different CPUs of your machine (if you have more than one of course) inside a kind of apply function. This is quite efficient and not very complicated to implement. </div><div><br></div><div>Hope it helps,</div><div><br></div><div>Wilfried</div><div><br></div><div> </div><br><div><div>Le 7 juil. 2011 à 11:29, Raquel A. Garcia a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><p><!--begin_signature-->Hi,</p><p>I'm getting this error message when I run my projections on future climate data:</p><p>In predict.lm(object, newdata, se.fit, scale = 1, type = ifelse(type == ... :<br>
prediction from a rank-deficient fit may be misleading</p><p>I wonder if anyone can help? I paste my code below.</p><p>Many thanks,</p><p>Raquel </p><p><br></p>
<div>### CALIBRATION AND VALIDATION ##############################</div>
<div><br>path <- "C:/Raquel_Garcia/fourthRun"</div>
<div>taxa <- c("frogs","snakes","mammals","birds")</div>
<div>library(BIOMOD)<br>source("C:/Raquel_Garcia/ModelsH.r")<br>source("C:/Raquel_Garcia/thirdRun/Ensemble.Forecasting.r")</div>
<div>clim <- c("clust1_4160a2", "clust2_4160a2", "clust3_4160a2", "clust1_4160a1b",<br>"clust2_4160a1b", "clust3_4160a1b", "clust1_4160b1", "clust2_4160b1", <br>
"clust3_4160b1", "clust1_8100a2", "clust2_8100a2", "clust3_8100a2", <br>"clust1_8100a1b", "clust2_8100a1b", "clust3_8100a1b", "clust1_8100b1", <br>
"clust2_8100b1", "clust3_8100b1")</div>
<div> </div>
<div>for (tx in 1:4)<br> {<br>#dir.create(paste(path, taxa[tx], sep="/"))<br>taxapath <- paste(path, taxa[tx],sep="/")</div>
<div><br>### CALIBRATION ################################################################</div>
<div>setwd(paste(path,"Data",sep="/"))</div>
<div>species<-read.table(paste(taxa[tx],"_1851cells_spp15.txt",sep=""),h=T,sep="\t") <br>sppnames <- names(species)</div>
<div>clim6190<-get(load("var6190_1851cells_3var")) # present climate table</div>
<div>coor<-read.table(paste("coorXY_1851cells.txt",sep=""),h=T,sep="\t") <br>coorXY <- coor[,2:3]<br> </div>
<div><br>for (f in 1:length(sppnames))<br> {<br> dir.create(paste(taxapath, "/", sppnames[f], sep=""))</div>
<div> setwd(paste(taxapath, "/", sppnames[f], sep=""))</div>
<div> <br> Initial.State(Response=species[,f], Explanatory=clim6190[,4:6], IndependentResponse=NULL, IndependentExplanatory=NULL,<a target="_blank" href="http://sp.name/">sp.name</a>=sppnames[f])</div>
<div> ModelsH(GLM = T, TypeGLM = "poly", Test = "AIC", GBM = T, No.trees = 2000, GAM = T,<br> Spline = 3, CTA = F, CV.tree = 50, ANN = T, CV.ann = 5, SRE = F, q=0.0025, FDA = T,<br> MARS = T, RF = T, NbRunEval = 5, DataSplit = 75, Yweights=NULL, Roc = T, Optimized.Threshold.Roc = T,<br>
Kappa = F, TSS=T, KeepPredIndependent = F, VarImport=5, NbRepPA=2, strategy="random",<br> coor=coorXY, nb.absences=1/3(dim(species)[1]))</div>
<div> </div>
<div># saving Pseudo-Absence data </div>
<div>save(Biomod.PA.data, file=paste(Biomod.material$species.names, "PAdata", sep="_"))<br>save(Biomod.PA.sample, file=paste(Biomod.material$species.names, "PAsample", sep="_"))</div>
<div> </div>
<div>### PREDICTIONS ################################################################</div>
<div> #Predictions on the original dataset <br> <br> CurrentPred(GLM=T, GBM=T, GAM=T, CTA=F, ANN=T, SRE=F, FDA=T, MARS=F, RF=T,<br> BinRoc=T, BinKappa=F, BinTSS=T, FiltKappa=F)</div>
<div> PredictionBestModel(GLM=T,GBM=T, GAM=T, CTA=F, ANN=T, FDA=T, MARS=F, RF=T, SRE=F,<br> method='all', Bin.trans = T, Filt.trans = T)</div>
<div> </div>
<div># saving evaluation results</div>
<div> save(Evaluation.results.TSS,file=paste("eval.TSS","_",Biomod.material$species.names,sep=""))<br> save(Evaluation.results.Roc,file=paste("eval.ROC","_",Biomod.material$species.names,sep=""))</div>
<div><br># saving VarImportance<br> <br> save(VarImportance,file=paste("VarImportance","_",Biomod.material$species.names,sep=""))</div>
<div><br>### CURRENT PROJECTIONS #########################################################</div>
<div> <br> Projection(Proj = clim6190[,4:6], Proj.name='CurrentF',<br> GLM = T, GBM = T, GAM = T, CTA = F, ANN = T, SRE = F, q=0.0025, FDA =T, MARS = T,<br> RF = T, BinRoc=T, BinKappa=F, BinTSS=T, FiltRoc=T, FiltKappa=F, FiltTSS=T, repetition.models=T)</div>
<div> Ensemble.Forecasting(Proj.name= "CurrentF", weight.method='TSS', PCA.median=T,<br> binary=T, bin.method='TSS', Test=T, decay=1.6, repetition.models=T, final.model.out=F)</div>
<div> </div>
<div>### FUTURE PROJECTIONS #########################################################</div>
<div> for (d in 1:18) <br> {<br> future <- read.table(paste(datapath, "/", clim[d], "_3var.txt", sep=""), header=T, sep="\t")</div>
<div> Projection(Proj = future, Proj.name=paste(clim[d],"F",sep=""), GLM = T, GBM = T, GAM = T,<br> CTA = F, ANN = T, SRE = F, q=0.0025, FDA =T, MARS = T, RF = T,<br> BinRoc = T, BinKappa = F, BinTSS = T, FiltRoc = T, FiltKappa = F, FiltTSS = T,<br>
repetition.models=T)</div>
<div> ProjectionBestModel(Proj.name=paste(clim[d],"F",sep=""), Bin.trans=T, Filt.trans=T, method='all')</div>
<div> </div>
<div>### ENSEMBLE FORECASTING (SDMs) ################################################</div>
<div> Ensemble.Forecasting(Proj.name= paste(clim[d],"F",sep=""), weight.method='TSS', PCA.median=T,<br> binary=T, bin.method='TSS', Test=T, decay=1.6, repetition.models=T, final.model.out=F)<br>
}</div>
<div> </div>
<div>### CLEANING UP ################################################################</div>
<div><br># saving workspace </div>
<div>save.image(file=paste(sppnames[f],"_workspace.RData",sep=""))</div>
<div> <br># remove objects not needed </div>
<div> t= c("path", "taxapath", "datapath", "sppnames", "varlist",
"species", "clim6190", "coorXY", "ModelsH", "Ensemble.Forecasting")
<br>
Rem = ls()<br> rm(list=(Rem[<a target="_blank" href="http://is.na/">is.na</a>(match(Rem, t))]))<br> <br> }<br>} </div> <br><p>................<br>
Raquel A. Garcia<br>
Integrative Biology and Global Change Group<br>
<a href="http://www.ibiochange.mncn.csic.es">www.ibiochange.mncn.csic.es</a><!--end_signature--></p>_______________________________________________<br>Biomod-commits mailing list<br><a href="mailto:Biomod-commits@lists.r-forge.r-project.org">Biomod-commits@lists.r-forge.r-project.org</a><br>https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-size: 12px; "><div>--------------------------</div><div>Dr. Wilfried Thuiller</div><div>Laboratoire d'Ecologie Alpine, UMR CNRS 5553</div><div>Université Joseph Fourier</div><div>BP53, 38041 Grenoble cedex 9, France</div><div>tel: +33 (0)4 76 51 44 97</div><div>fax: +33 (0)4 76 51 42 79</div><div><br></div><div>Email: <a href="mailto:wilfried.thuiller@ujf-grenoble.fr">wilfried.thuiller@ujf-grenoble.fr</a><br>Personal website: <a href="http://www.will.chez-alice.fr/">http://www.will.chez-alice.fr</a><br>Team website: <a href="http://www-leca.ujf-grenoble.fr/equipes/emabio.htm">http://www-leca.ujf-grenoble.fr/equipes/emabio.htm</a><br><br>FP6 European MACIS project: <a href="http://www.macis-project.net/">http://www.macis-project.net</a><br>FP6 European EcoChange project: <a href="http://www.ecochange-project.eu/">http://www.ecochange-project.eu</a></div><div><br></div></span></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></body></html>