Hey Wilfried and all,<div><br></div><div>So check to see if I did this correctly</div><div><br></div><div><div>> Ensemble.Forecasting(Proj.name="cccm80a2a", weight.method='Roc', PCA.media=F, binary=T, bin.method='Roc', Test=T, decay="proportional", repetition.models=T, final.model.out=TRUE)</div>
<div><div>> Ensemble.Forecasting(Proj.name="had80a2a", weight.method='Roc', PCA.media=F, binary=T, bin.method='Roc', Test=T, decay="proportional", repetition.models=T, final.model.out=TRUE)</div>
</div><div><br></div><div><div>> load("proj.cccm80a2a/Total_consensus_cccm80a2a_Bin")</div><div>> load("proj.had80a2a/Total_consensus_had80a2a_Bin")</div></div><div><br></div><div>> MyAverageA2A=apply(cbind(Total_consensus_cccm80a2a_Bin[,1,"prob.mean.weighted"], Total_consensus_had80a2a_Bin[,1,"prob.mean.weighted"]),1,mean)</div>
<div>> MyThresA2A=apply(cbind(consensus_cccm80a2a_results[[1]][[3]][3,2], consensus_had80a2a_results[[1]][[3]][3,2]),1,mean)</div><div>> MyAverageBinA2A=BinaryTransformation(MyAverageA2A, MyThresA2A)</div><div><br></div>
<div>or would it be:</div><div><br></div><div><div>> MyAverageA2A=apply(cbind(Total_consensus_cccm80a2a_Bin[,1,"prob.mean.weighted"], Total_consensus_had80a2a_Bin[,1,"prob.mean.weighted"]),1,mean)</div>
<div>> MyThresA2A=mean(consensus_cccm80a2a_results[[1]][[3]][3,2])</div><div>> MyAverageBinA2A=BinaryTransformation(MyAverageA2A, MyThresA2A)</div></div><div><br></div><div>does it make a difference?</div><div><br></div>
<div>Also when I did the level.plot</div><div><br></div><div>> level.plot(MyAverageA2A, Coor) returns a visual and </div><div>> level.plot(MyAverageBinA2A, Coor) does not return a visual.....why would this be?</div>
<div><br></div><div>Thank you for your time and consideration!  It is most appreciated.</div><div>Ashley</div><div><br></div><div class="gmail_quote">On Thu, Feb 23, 2012 at 2:21 AM, Wilfried Thuiller <span dir="ltr"><<a href="mailto:wilfried.thuiller@ujf-grenoble.fr" target="_blank">wilfried.thuiller@ujf-grenoble.fr</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><blockquote type="cite"><div><br></div><div>So I have averaged the binary prop.mean.weighted projections (shown below) and next I want to average the thresholds (from consensus_cccm80a2a_results) correct? How do I navigate to these thresholds.  And once I have taken the average can I visualize the averaged output using level.plot?</div>


<div><br></div><div><font color="#222222" face="arial, sans-serif"> MyAverage=apply(cbind(Total_consensus_cccm80a2a_Bin[,1,"prob.mean.weighted"], Total_consensus_had80a2a_Bin[,1,"prob.mean.weighted"]),1,mean)</font></div>

</blockquote><div><br></div></div><div>The total consensus projections are simply the average of the weighted probabilities means of all repetitions and pseudo-absence projections. </div><div>Just do the same for the threshold:</div>

<div><br></div><div>MyTre = mean(consensus_cccm80a2a_results $Cflorida$Cflorida$thresholds$prob.mean.weighted)</div><div><br></div><div>then, simply run the BinaryTransformation function</div><div><br></div><div>MyAverageBin = BinaryTransformation(MyAverage, MyTre)</div>

<div><br></div><div>Something you might want to do as well is to remove the projections from the models made on 100% of the data. Here when you run the Ensemble Forecasting, you have the projections from the model trained on 100% of the data and and the ones trained on 70% of the data. Better to avoid mixing the two on the final outcome you want to look at. </div>

<div><br></div><div>Just add one option into the Ensemble Forecasting option:</div><div><br></div><div>Ensemble.Forecasting(Proj.name="cccm80a2a", weight.method='Roc', PCA.media=F, binary=T, bin.method='Roc', Test=T, decay="proportional", repetition.models=T, final.model.out=TRUE)</div>

<div>### note there was a mistake in the help file, it was said that final.model.out=TRUE keeps the final model in. This is the way around. I have just updated the help file. </div><div><br></div><div>Additionnaly, I will also recommend to use the decay = "proportional". The weights are awarded for each method proportionaly to their evaluation scores. The advantage is that the discrimination is more fair than with the decay. In the latter case, close scores can strongly diverge in the weights they are awarded, when the proportional method will consider them as being fairly similar in prediction quality and award them a similar weight.</div>

<div><br></div><div><br></div><div>For the level.plot, once you have made your averaging, you should have a vector of probability or binary values</div><div>You should also have your coordinates from somewhere</div><div>
<br>
</div><div>level.plot(MyAverage, MyCoordinates)</div><div><br></div><div><br></div><div>Cheers,</div><div>Wilfried</div><div><div><div><br></div><div><br></div><br><blockquote type="cite">
<div><br></div><div>Thanks so much for your help!</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_quote">On Wed, Feb 22, 2012 at 12:36 PM, Wilfried Thuiller <span dir="ltr"><<a href="mailto:wilfried.thuiller@ujf-grenoble.fr" target="_blank">wilfried.thuiller@ujf-grenoble.fr</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">

<div>Dear Ashley,</div><div><br></div><div>The weights, thresholds etc are the same because they are estimated from the models, not from the projections. The Ensemble.Forecasting function does not re-run the models, it just pick up the results from every model run in Models, and then estimate the weights and threshold. These weights are then used to make the ensemble forecast. Obviously, the weighting scheme is not going to change in function of the climate change scenario you use because it only relates to the models themselves that are independent of the climate change scenarios. </div>


<div><br></div><div>Concerning your second question, of course it could be done easily. BIOMOD does not do the for you but this is rather easy to compute. </div><div><br></div><div>Averaging needs to be done with the probability values (not the binary ones). </div>


<div><br></div><div>For instance, if you want to average your two projections for Cflorida:</div><div><br></div><div>load the Total_consensus projections for each GCMs. They should be named along these lines</div><div><br>


</div><div>load("MYPATH/Total_consensus_cccm80a2a")</div><div><br></div><div>Let's say your second GCM is called hadcm3</div><div><br></div><div>load("MYPATH/Total_consensus_hadcm3a2a")</div><div>

<br>
</div><div>then let's say you want to average the prob.mean.weighted projections. </div><div><br></div><div>Each Total_consensus file is a 3-D array. In the second dimension, you should just have one column (one species). The third dimension corresponds to the different ensemble forecast strategies. </div>


<div><br></div><div>We are going to use the mean function between the two datasets, using the apply function.</div><div><br></div><div>MyAverage = apply(cbind(Total_consensus_cccm80a2a[,1,"prob.mean.weighted"], Total_consensus_hadcm3a2a[,1,"prob.mean.weighted"]), 1, mean)</div>


<div><br></div><div>For the threshold, just do the same and take the average. </div><div><br></div><div>Does it help? </div><div><br></div><div>Wilfried</div><div><br></div><div><br></div><div><br></div><div><br></div><div>


<br></div><div><br></div><div><br></div><div><div>Le 22 févr. 2012 à 18:18, Ashley Brooks a écrit :</div><br><blockquote type="cite"><div><div>Hi All!<div><br></div><div>I have a few questions that I'm a little confused about and need some clarification:</div>


<div><br></div><div>1) I have run a few projections and then ensemble forecasts using different sets of future climate data.  However the weights, thresholds, etc for the different runs have the same exact output.  Is this normal or have I messed something up somewhere?  See below:</div>




<div><br></div><div>> Initial.State(Response=my.data[1], Explanatory=my.data[,4:13], IndependentResponse=my.data[1], IndependentExplanatory=my.data[,4:13])</div><div><br></div><div>> Models(GLM=T, TypeGLM="poly", Test="AIC", GBM=T, No.trees=2000, GAM=T, Spline=3, CTA=T, CV.tree=50, ANN=T, CV.ann=2, SRE=T,quant=0.05, FDA=T, MARS=T, RF=T, NbRunEval=3, DataSplit=70, Yweights=NULL, Roc=T, Optimized.Threshold.Roc=T, Kappa=T, TSS=T, KeepPredIndependent=T, VarImport=5, NbRepPA=2, strategy="circles", coor=Coor, distance=2, nb.absences=1000)</div>




<div><br></div><div>> Projection(Proj=cccm80a2a[,3:12], Proj.name='cccm80a2a', GLM=T, GBM=T, GAM=T, CTA=T, ANN=T, SRE=T, quant=0.05, FDA=F, MARS=T, RF=T, BinRoc=T, BinKappa=F, BinTSS=F, FiltRoc=T, FiltKappa=F, FiltTSS=F, repetition.models=T)</div>




<div><br></div><div><div>> Ensemble.Forecasting(Proj.name="cccm80a2a", weight.method='Roc', PCA.media=F, binary=T, bin.method='Roc', Test=T, decay=1.6, repetition.models=T)</div><div>Cflorida  </div>




<div><br></div><div> consensus_cccm80a2a_results </div><div>$Cflorida</div><div>$Cflorida$weights</div><div>            ANN    CTA    GAM    GBM    GLM   MARS FDA     RF SRE</div><div>PA1      0.0371 0.0232 0.1522 0.2434 0.0951 0.0594   0 0.3895   0</div>




<div>PA1_rep1 0.0371 0.0232 0.1522 0.0594 0.0951 0.3895   0 0.2434   0</div><div>PA1_rep2 0.0594 0.0232 0.1522 0.3895 0.0951 0.0371   0 0.2434   0</div><div>PA1_rep3 0.0232 0.0483 0.0951 0.2434 0.0483 0.1522   0 0.3895   0</div>




<div>PA2      0.0371 0.0232 0.0951 0.1522 0.0594 0.3165   0 0.3165   0</div><div>PA2_rep1 0.1022 0.0232 0.1022 0.2434 0.0371 0.3895   0 0.1022   0</div><div>PA2_rep2 0.0371 0.0232 0.0951 0.1522 0.0594 0.2434   0 0.3895   0</div>




<div>PA2_rep3 0.0302 0.0302 0.0951 0.1522 0.0594 0.3165   0 0.3165   0</div><div><br></div><div>$Cflorida$PCA.median</div><div>         model.selected</div><div>PA1                  NA</div><div>PA1_rep1             NA</div>




<div>PA1_rep2             NA</div><div>PA1_rep3             NA</div><div>PA2                  NA</div><div>PA2_rep1             NA</div><div>PA2_rep2             NA</div><div>PA2_rep3             NA</div><div><br></div><div>




$Cflorida$thresholds</div><div>                        PA1 PA1_rep1 PA1_rep2 PA1_rep3      PA2 PA2_rep1 PA2_rep2 PA2_rep3</div><div>prob.mean          552.4331 476.5176 476.5653 459.1243 485.8907 485.8569 428.8626 292.2260</div>




<div>prob.mean.weighted 567.7707 305.4160 432.0515 423.9614 447.9690 351.9328 297.7658 237.1679</div><div>median             599.1970 529.4070 492.7660 582.6600 594.6120 520.6430 497.5000 301.3960</div><div>Roc.mean           500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000</div>




<div>Kappa.mean         500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000</div><div>TSS.mean           500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000</div><div><br></div><div>




$Cflorida$test.results</div><div>                         PA1  PA1_rep1  PA1_rep2  PA1_rep3       PA2  PA2_rep1  PA2_rep2</div><div>prob.mean          0.9986525 0.9958785 0.9951836 0.9978842 0.9985311 0.9991299 0.9975960</div>




<div>prob.mean.weighted 0.9995932 0.9970734 0.9957514 0.9991808 0.9993503 0.9987062 0.9987006</div><div>median             0.9982740 0.9945085 0.9942486 0.9974350 0.9977938 0.9975819 0.9970339</div><div>Roc.mean           0.9979492 0.9911780 0.9908023 0.9960763 0.9982514 0.9969859 0.9920226</div>




<div>Kappa.mean         0.9991215 0.9951836 0.9917288 0.9977910 0.9988672 0.9991667 0.9926667</div><div>TSS.mean           0.9987797 0.9946638 0.9928955 0.9974322 0.9986610 0.9993701 0.9954548</div><div>                    PA2_rep3</div>




<div>prob.mean          0.9971582</div><div>prob.mean.weighted 0.9979944</div><div>median             0.9972599</div><div>Roc.mean           0.9948672</div><div>Kappa.mean         0.9934689</div><div>TSS.mean           0.9931836</div>




</div><div> </div><div>And then I get the same exact results for other runs as well:</div><div><br></div><div>> Projection(Proj=cccm80b2b[,3:12], Proj.name='cccm80b2b', GLM=T, GBM=T, GAM=T, CTA=T, ANN=T, SRE=T, quant=0.05, FDA=F, MARS=T, RF=T, BinRoc=T, BinKappa=F, BinTSS=F, FiltRoc=T, FiltKappa=F, FiltTSS=F, repetition.models=T)</div>




<div><br></div><div>> Ensemble.Forecasting(Proj.name="cccm80b2b", weight.method='Roc', PCA.media=F, binary=T, bin.method='Roc', Test=T, decay=1.6, repetition.models=T)</div><div>Cflorida  </div>




<div><br></div><div> consensus_cccm80b2b_results </div><div>$Cflorida</div><div>$Cflorida$weights</div><div>            ANN    CTA    GAM    GBM    GLM   MARS FDA     RF SRE</div><div>PA1      0.0371 0.0232 0.1522 0.2434 0.0951 0.0594   0 0.3895   0</div>




<div>PA1_rep1 0.0371 0.0232 0.1522 0.0594 0.0951 0.3895   0 0.2434   0</div><div>PA1_rep2 0.0594 0.0232 0.1522 0.3895 0.0951 0.0371   0 0.2434   0</div><div>PA1_rep3 0.0232 0.0483 0.0951 0.2434 0.0483 0.1522   0 0.3895   0</div>




<div>PA2      0.0371 0.0232 0.0951 0.1522 0.0594 0.3165   0 0.3165   0</div><div>PA2_rep1 0.1022 0.0232 0.1022 0.2434 0.0371 0.3895   0 0.1022   0</div><div>PA2_rep2 0.0371 0.0232 0.0951 0.1522 0.0594 0.2434   0 0.3895   0</div>




<div>PA2_rep3 0.0302 0.0302 0.0951 0.1522 0.0594 0.3165   0 0.3165   0</div><div><br></div><div>$Cflorida$PCA.median</div><div>         model.selected</div><div>PA1                  NA</div><div>PA1_rep1             NA</div>




<div>PA1_rep2             NA</div><div>PA1_rep3             NA</div><div>PA2                  NA</div><div>PA2_rep1             NA</div><div>PA2_rep2             NA</div><div>PA2_rep3             NA</div><div><br></div><div>




$Cflorida$thresholds</div><div>                        PA1 PA1_rep1 PA1_rep2 PA1_rep3      PA2 PA2_rep1 PA2_rep2 PA2_rep3</div><div>prob.mean          552.4331 476.5176 476.5653 459.1243 485.8907 485.8569 428.8626 292.2260</div>




<div>prob.mean.weighted 567.7707 305.4160 432.0515 423.9614 447.9690 351.9328 297.7658 237.1679</div><div>median             599.1970 529.4070 492.7660 582.6600 594.6120 520.6430 497.5000 301.3960</div><div>Roc.mean           500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000</div>




<div>Kappa.mean         500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000</div><div>TSS.mean           500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000 500.0000</div><div><br></div><div>




$Cflorida$test.results</div><div>                         PA1  PA1_rep1  PA1_rep2  PA1_rep3       PA2  PA2_rep1  PA2_rep2  PA2_rep3</div><div>prob.mean          0.9986525 0.9958785 0.9951836 0.9978842 0.9985311 0.9991299 0.9975960 0.9971582</div>




<div>prob.mean.weighted 0.9995932 0.9970734 0.9957514 0.9991808 0.9993503 0.9987062 0.9987006 0.9979944</div><div>median             0.9982740 0.9945085 0.9942486 0.9974350 0.9977938 0.9975819 0.9970339 0.9972599</div><div>




Roc.mean           0.9979492 0.9911780 0.9908023 0.9960763 0.9982514 0.9969859 0.9920226 0.9948672</div><div>Kappa.mean         0.9991215 0.9951836 0.9917288 0.9977910 0.9988672 0.9991667 0.9926667 0.9934689</div><div>TSS.mean           0.9987797 0.9946638 0.9928955 0.9974322 0.9986610 0.9993701 0.9954548 0.9931836</div>




<div><br></div><div><br></div></div></div><div><p class="MsoNormal" style="margin-bottom:0.0001pt"><br></p><p class="MsoNormal" style="margin-bottom:0.0001pt">2)  Also I am using two GCM (cccma and had)  with two strylines each (A2A and B2B) and would like to average the two GCM's to have just two predictions (one for the A2A storyline and one for the B2B storyline).  My question is how do I average the two GCM's?  Can I do this in Biomod or do I do it in another program?  What commands would I use?</p>


<div><p class="MsoNormal" style="margin-bottom:0.0001pt"><br></p><p class="MsoNormal" style="margin-bottom:0.0001pt">Any advice or help would be most appreciated!</p><p class="MsoNormal" style="margin-bottom:0.0001pt">
Thanks,</p><p class="MsoNormal" style="margin-bottom:0.0001pt">Ashley</p><div><br></div></div></div>
_______________________________________________<br>Biomod-commits mailing list<br><a href="mailto:Biomod-commits@lists.r-forge.r-project.org" target="_blank">Biomod-commits@lists.r-forge.r-project.org</a><br><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits</a></blockquote>


</div><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


<div><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: <a href="tel:%2B33%20%280%294%2076%2051%2044%2097" value="+33476514497" target="_blank">+33 (0)4 76 51 44 97</a></div><div>fax: <a href="tel:%2B33%20%280%294%2076%2051%2042%2079" value="+33476514279" target="_blank">+33 (0)4 76 51 42 79</a></div>


<div><br></div><div>Email: <a href="mailto:wilfried.thuiller@ujf-grenoble.fr" target="_blank">wilfried.thuiller@ujf-grenoble.fr</a><br>Personal website: <a href="http://www.will.chez-alice.fr/" target="_blank">http://www.will.chez-alice.fr</a><br>


Team website: <a href="http://www-leca.ujf-grenoble.fr/equipes/emabio.htm" target="_blank">http://www-leca.ujf-grenoble.fr/equipes/emabio.htm</a><br><br>ERC Starting Grant TEEMBIO project: <a href="http://www.will.chez-alice.fr/Research.html" target="_blank">http://www.will.chez-alice.fr/Research.html</a><br>


FP6 European EcoChange project: <a href="http://www.ecochange-project.eu/" target="_blank">http://www.ecochange-project.eu</a></div><div><br></div></span></div></div></span><br></div></span><br></div></span><br></div></span><br>


</span><br>
</div>
<br></div></blockquote></div><br>
_______________________________________________<br>Biomod-commits mailing list<br><a href="mailto:Biomod-commits@lists.r-forge.r-project.org" target="_blank">Biomod-commits@lists.r-forge.r-project.org</a><br><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits</a></blockquote>

</div></div></div><div><div><br><div>
<div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div><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: <a href="tel:%2B33%20%280%294%2076%2051%2044%2097" value="+33476514497" target="_blank">+33 (0)4 76 51 44 97</a></div>

<div>fax: <a href="tel:%2B33%20%280%294%2076%2051%2042%2079" value="+33476514279" target="_blank">+33 (0)4 76 51 42 79</a></div><div><br></div><div>Email: <a href="mailto:wilfried.thuiller@ujf-grenoble.fr" target="_blank">wilfried.thuiller@ujf-grenoble.fr</a><br>

Personal website: <a href="http://www.will.chez-alice.fr/" target="_blank">http://www.will.chez-alice.fr</a><br>Team website: <a href="http://www-leca.ujf-grenoble.fr/equipes/emabio.htm" target="_blank">http://www-leca.ujf-grenoble.fr/equipes/emabio.htm</a><br>

<br>ERC Starting Grant TEEMBIO project: <a href="http://www.will.chez-alice.fr/Research.html" target="_blank">http://www.will.chez-alice.fr/Research.html</a><br>FP6 European EcoChange project: <a href="http://www.ecochange-project.eu/" target="_blank">http://www.ecochange-project.eu</a></div>

<div><br></div></span></div></div><br></div><br></div><br></div><br><br>
</div>
<br></div></div></div></blockquote></div><br></div>