Commit 3abfe9b9 authored by pfreon's avatar pfreon
Browse files

Major changes: new models and warnings

Addition of five models using the Ricker stock-recruitement equation to describe the function CPUE = f(V).
Addition of warning when the noteworthy values of MSY and/or MSE are negative or associated to extremely large confidence intervals.
Increase of the maximum number of iterations in the Marquardt algorithm (from 100 to 150).
Improvement of plots MSY = f(V) et MSE = f(V) with minimum value set to zero and prevention of plots when all values are negative.
Addition of the fitted curves on the plots CPUE = f(V) and Y = f(V).
Increase of the limit range of effort variation from 40% to 100%.
Increase of the range intervals of parameter c of the generalized model for shifting to the Fox or Graham-Schaefer model. Initially 0.8-1.2 and 1.8-2.2 respectively. Now 0.6-1.4 and 1.6 to 2.5 respectively.
Improvement of the answers when the software failled to find a convenient model (now more precise reason are provided).
Addition of warnings when contradiction are found between answers to different questions regarding the status of the stock and the results of the model regarding the level of exploitation.
Improvement of the caption on figures MSY = f(V) and MSE = f(E).
parent 34effc1b
......@@ -459,8 +459,8 @@ public class CadreMain extends JFrame {
}
public void helpAbout_actionPerformed(ActionEvent e) {
//Cadre_SplitPlot dc=new Cadre_SplitPlot(Global.jackknifePlot);
//dc.setVisible(true);
//Cadre_SplitPlot dc=new Cadre_SplitPlot(Global.jackknifePlot);
//dc.setVisible(true);
CadreMain_AboutBox dlg = new CadreMain_AboutBox(this);
Dimension dlgSize = dlg.getPreferredSize();
......@@ -533,7 +533,7 @@ public class CadreMain extends JFrame {
dlg.setTitle("Climprod: Climprod file editor ");
dlg.setModal(true);
dlg.setVisible(true);
// int d=dlg.getResult();
// int d=dlg.getResult();
/* if(d==dlg.Ok_Option)
{
......@@ -630,7 +630,7 @@ public class CadreMain extends JFrame {
b1 = true;
b3 = Global.validationOk;
b2 = Global.modelisationOk;
b4 = b3 && (((Global.numero_modele > 5) || (Global.numero_modele < 2)) && (Global.numero_modele != 20));
b4 = b3 && (((Global.numero_modele > 5) || (Global.numero_modele < 2)) && (Global.numero_modele != 20) && (Global.numero_modele != 33));
b5 = Global.test_jackknife;
}
this.jPanData.setVisible(b1);
......@@ -810,7 +810,9 @@ public class CadreMain extends JFrame {
if (Global.nom_fichier != null) {
faits = "Data file path:" + Global.nom_fichier + s + s;
faits = faits + "Number of observed data years: " + Data.getNbYears() + s + s;
faits = faits + "Number of observed data (years): " + Data.getNbYears() + s;
Global.temp=Global.RangeEffort();
faits = faits + "The relative range of fishing effort variation is " + nf.format(Global.temp*100) + "%" + s + s;
if (Global.effort_preponderant != -1 || Global.environmental_influence != "") {
if (Global.effort_preponderant == 1) {
faits = faits + "Influence of fishing effort on CPUE is preponderant" + s;
......@@ -822,11 +824,13 @@ public class CadreMain extends JFrame {
if (Global.environmental_influence != "") {
faits = faits + "Environmental influence: " + Global.environmental_influence + s;
}
if (Global.recruitment_age != -1) {
faits = faits + "Age at recruitment: " + Global.recruitment_age + s;
faits = faits + "Age at the begining of environmental influence: " + Global.begin_influence_period + s;
faits = faits + "Age at the end of environmental influence: " + Global.end_influence_period + s + s;
}
String[] cpu_relation = {"", "Linear", "Exponential", "General ", "Power", "Quadratic", "Exponential_Additif", "Exponential_Not_Additif"};
String[] cpu_relation = {"", "Linear", "Exponential", "General ", "Power", "Quadratic", "Exponential_additive", "Exponential_multiplicative"};
//String[] cpu_e={"Linear [CPUE=a+b.E]", "General [CPUE=(a+b.E)^(1/(c-1))]","Exponential [CPUE=a.exp(b.E)]"};
if (Global.relationCPU_E != 0) {
faits = faits + "Relation between CPUE and E: " + cpu_relation[Global.relationCPU_E] + s;
......@@ -838,31 +842,30 @@ public class CadreMain extends JFrame {
}
if (Global.modelisationOk)
{
{
faits = faits + s + "Selected model: " + RechercheModele.getEquation() + s;
faits = faits + "Number of years used to fit the model: " + Data.getNbDataRetenue() + s;
faits = faits + "Number of degrees of freedom: " + Integer.toString(Data.getNbDataRetenue() - Global.nbre_param) + s + s;
// faits=faits +"Parameters"+"\t"+"Actual value"+" "+"\t"+"Initial value"+s;
String[][] res$ = (String[][]) Modele.getResult();
for (int i = 0; i < Global.nbre_param + 1; i++)
{
{
for (int j = 0; j < res$[i].length; j++) //faits=faits+" "+res$[i][j]+" "+"\t";
{faits = faits + res$[i][j] + "\t";}
faits = faits + s;
}
faits = faits + s;
for (int i = Global.nbre_param + 3; i < res$.length; i++)
{
{
for (int j = 0; j < res$[i].length; j++)
{
{
if (res$[i][j] != null)
{faits = faits + res$[i][j] + "\t";}
{faits = faits + res$[i][j] + "\t";}
}
faits = faits + s;
}
if (Global.validationOk)
{
{
Validation.valide_modele();
Validation.getParamResult();
if (Global.coeff_determination == 0.0)
......@@ -873,20 +876,33 @@ public class CadreMain extends JFrame {
faits=faits + s + " " + Global.param$[i]+ " " + Global.Test_Jackknife_Param$[Global.Res_Test_Jackknife_Par[i]];
else
faits=faits + s + " " + Global.param$[i]+ "** " + Global.Test_Jackknife_Param$[Global.Res_Test_Jackknife_Par[i]];
}
if (Global.Flag_pb_jackknife_Tot != 0) faits=faits + s + Global.message2$;
if (Global.test_jackknife)
{faits = faits + s + "Overall T_Jackknife on parameters: good" + s;}
else {faits = faits + s + "Overall T_Jackknife on parameters: bad" + s;}
if(Global.r_jk != 0.00)
faits = faits + s + "Jackknife coefficient of determination R²: " + nf.format(Global.r_jk) + s;
else {
faits = faits + s + "Jackknife coefficient of determination R²***: " + nf.format(Global.r_jk) + s;
faits=faits+s+"***Jackknife R² estimate was negative and consequently set to zero.\nThis result is due to a poor fitting by the Marquart algorithm\nand it is commonly observed when the model does not include\nan intercept parameter or when the model includes a non-linear function.\nConsequently the display of the jackknife R² graph is not available.";
}
}
}
}
if (Global.Flag_pb_jackknife_Tot != 0) faits=faits + s + Global.message$[0];
if (Global.test_jackknife)
{faits = faits + s + "Overall T_Jackknife on parameters: good" + s;}
else {faits = faits + s + "Overall T_Jackknife on parameters: bad" + s;}
if(Global.r_jk != 0.00)
faits = faits + s + "Jackknife coefficient of determination R²: " + nf.format(Global.r_jk) + s;
else {
faits = faits + s + "Jackknife coefficient of determination R²***: " + nf.format(Global.r_jk) + s;
faits=faits+s+"***Jackknife R² estimate was negative and consequently set to zero.\nThis result is due to a poor fitting by the Marquart algorithm\nand it is commonly observed when the model does not include\nan intercept parameter or when the model includes a non-linear function.\nConsequently the display of the jackknife R² graph is not available.";
}
}
if (Global.AllPredictedNegativeTot >0) faits=faits + s + Global.message$[3];
if ((Global.Max_95_Noteworthy_MSE == 4 || Global.Max_95_Noteworthy_MSY == 4) && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33) {
faits=faits + s + Global.message$[4];}
else {
if ((Global.Min_95_Noteworthy_MSE>=4 && Global.Min_95_Noteworthy_MSY>=4) && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33) {
faits=faits + s + Global.message$[5]; }
else {
if (Global.Min_95_Noteworthy_MSE>=4 && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33) {
faits=faits + s + Global.message$[1]; }
if (Global.Min_95_Noteworthy_MSY>=4 && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33) {
faits=faits + s + Global.message$[2]; }
}
}
}
}
} else {
faits = "Data file: No selected file.";
......@@ -913,7 +929,7 @@ public class CadreMain extends JFrame {
}
/*
Lecture dernire configuration
Lecture dernière configuration
*/
private void readConfig() {
......@@ -998,7 +1014,7 @@ public class CadreMain extends JFrame {
}
/*
Sauvegarde dernire configuration
Sauvegarde dernière configuration
*/
private void saveConfig() throws IOException {
//System.out.println("configFile " +configFile);
......
......@@ -382,7 +382,7 @@ public class Cadre_ModeleDirect extends JFrame {
UtilCadre.Centrer(dlgSp);
dlgSp.setVisible(true);
vPlot.add(dlgSp);
} else {
msg = new MsgDialogBox(0, "In order to display these plots\n you have to fit a model", 0, Global.CadreMain);
}
......@@ -567,10 +567,10 @@ private void displayList(String[] liste) {
Global.end_influence_period = jcboEnd.getSelectedIndex();
}
/***************************************************
Any change in age warnings here must be repeated
in the QuestionReponse.java file, cases 17, 52 & 58.
****************************************************
/***********************************************************
Any change in age warnings related to ages here must be
repeated in the QuestionReponse.java file, cases 17, 52 & 58.
************************************************************
*/
//System.out.println("Global.recruitment_age: " + Global.recruitment_age + "Global.nb_classes_exploitees: " + Global.nb_classes_exploitees + " Global.begin_influence_period: " + Global.begin_influence_period + "Global.end_influence_period: " + Global.end_influence_period);
if (Global.nb_classes_exploitees > 5 && Global.nb_classes_exploitees < 9) {
......@@ -612,6 +612,22 @@ in the QuestionReponse.java file, cases 17, 52 & 58.
Validation.valide_modele();
renseignerTable(jTableValidation, Validation.getParamResult());
nbFit++;
MsgDialogBox msg;
if (Global.AllPredictedNegativeTot >0)
msg = new MsgDialogBox(0, Global.message$[3], 0, Global.CadreMain);
if ((Global.Max_95_Noteworthy_MSE == 4 || Global.Max_95_Noteworthy_MSY == 4) && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33)
msg = new MsgDialogBox(0, Global.message$[4], 0, Global.CadreMain);
else {
if ((Global.Min_95_Noteworthy_MSE>=4 && Global.Min_95_Noteworthy_MSY>=4) && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33)
msg = new MsgDialogBox(0, Global.message$[5], 0, Global.CadreMain);
else {
if ((Global.Min_95_Noteworthy_MSE>=4 && Global.numero_modele != 20) && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33)
msg = new MsgDialogBox(0, Global.message$[1], 0, Global.CadreMain);
if ((Global.Min_95_Noteworthy_MSY>=4 && Global.numero_modele != 20) && Global.numero_modele != 20 && Global.numero_modele > 5 && Global.numero_modele < 2 && Global.numero_modele != 33)
msg = new MsgDialogBox(0, Global.message$[2], 0, Global.CadreMain);
}
}
/* if(Global.nb_classes_exploitees==0)
{
msg=new MsgDialogBox(0,"Please provide the number of significantly/n exploited year classes",0);
......
......@@ -17,31 +17,31 @@ public class EquationModele {
* @param int[]i.
* @return un double, la moyenne.
*/
static public double fonction_modele(double ff, double vv, double vba, double par[]) {
static public double fonction_modele(double ff, double vv, double vba, double par[]) { // vv = V; vba = V moyenne pondérée.
double puec = 0;
double tmp, tmp1, tmp2;
int numeromod = Global.numero_modele;
//System.out.println("numero" + numeromod);
switch (numeromod) {
case 0:
case 0: // CPUE=a+b.E
puec = par[0] + par[1] * ff;
break;
case 1:
case 1: // CPUE=a.exp(b.E)
puec = par[0] * Math.exp(par[1] * ff);
break;
case 2:
case 2: // CPUE=a+b.V
puec = par[0] + par[1] * vba;
break;
case 3:
case 3: // CPUE=a.V^b
puec = par[0] * Math.pow(vba, par[1]);
break;
case 4:
case 4: // CPUE=a+b.V^c
puec = par[0] + par[1] * Math.pow(vba, par[2]);
break;
case 5:
puec = par[0] * vba + par[1] * (vba * vba) + par[2];
case 5: // CPUE=a+b.V+c.V^2. avant CPUE=a.V+b.V^2+c. Commentaire 2020
puec = par[0] + par[1] * vba + par[2] * (vba * vba);
break;
case 6:
case 6: // CPUE=(a+b.E)^(1/(c-1))
tmp = par[0] + par[1] * ff;
if (tmp > 0) {
puec = Math.pow(tmp, 1.0 / (par[2] - 1));
......@@ -49,175 +49,218 @@ public class EquationModele {
puec = -Math.pow(-tmp, 1.0 / (par[2] - 1));
}
break;
case 7:
case 7: // CPUE=a.V^b+c.E
puec = par[0] * Math.pow(vba, par[1]) + par[2] * ff;
break;
case 8:
case 34: // CPUE=a.V.exp(b.V)+c.E ABONDANCE
puec = par[0] * vba * Math.exp(par[1] * vba) + (par[2] * ff);
break;
/*case 35: // CPUE=a+b.V.exp(c.V)+d.E (Idem modèle 34 CPUE=a.V.exp(b.V)+c.E mais avec constante. Ajustement pas toujours réaliste, bénéfice minime, paramètre 'a' souvent non significatif. Parfois pb d'ajustement (ne converge pas ou MSY et MSE remarquables = 0 ou < 0.
puec = par[0] + par[1]* vba * Math.exp(par[2]*vba) + (par[3] * ff);
break;*/
case 35: // CPUE=a.V.exp(b.V).exp(c.E) ABONDANCE
puec = par[0] * vba * Math.exp(par[1] * vba)*Math.exp(par[2] * ff);
break;
case 37: // CPUE=a.V.exp(b.V)+c.(a.V.exp(b.V))^2).E // CAPTURABILITE. Le modèle CPUE=a.V.exp(b.V)+c.(V.exp(b.V))^2).E donne résultats identiques mais parfois ne converge pas (R² = 0).
puec = par[0] * vv * Math.exp(par[1] * vv) + par[2] *(par[0]*vv * Math.exp(par[1]*vv))* (par[0]*vba * Math.exp(par[1]*vba)) * ff; //puec = par[0]* vv * Math.exp(par[1] * vv) + par[2] *(vv * Math.exp(par[1]*vv))* (vba * Math.exp(par[1]*vba)) * ff; //
break;
case 36: // CPUE=a.V.exp(b.V).exp(c.V.exp(b.V).E) // CAPTURABILITE
puec = par[0] * vv * Math.exp(par[1] * vv) * Math.exp(par[2] * vba * Math.exp(par[1]*vba)* ff);
break;
/* case 38: // CPUE=a.V.exp(b.V).exp(c.V.exp(d.V).E) // ABONDANCE et/ou MIXTE. Pb: ajustement difficile et souvent irréaliste.
puec = par[0] * vv * Math.exp(par[1] * vv) * Math.exp(par[2] * vv * Math.exp(par[3]*vv)* ff);
break; */
case 8: // CPUE=a+b.V+c.E
puec = par[0] + par[1] * vba + par[2] * ff;
break;
case 9:
case 9: // CPUE=a.V+b.E
puec = par[0] * vba + par[1] * ff;
break;
case 10:
case 10: // CPUE=a+b.V+c.V^2+d.E
puec = par[0] + par[1] * vba + par[2] * (vba * vba) + par[3] * ff;
break;
case 11:
case 11: // CPUE=a.V^b.exp(c.E)
puec = par[0] * Math.pow(vba, par[1]) * Math.exp(par[2] * ff);
break;
case 12:
case 12: // CPUE=(a+b.V).exp(c.E)
puec = (par[0] + par[1] * vba) * Math.exp(par[2] * ff);
break;
case 13:
case 13: // CPUE=a.V.exp(b.E)
puec = par[0] * vba * Math.exp(par[1] * ff);
break;
case 14:
puec = par[0] + par[1] * vv - par[2] * (par[0] + par[1] * vv) * (par[0] + par[1] * vba) * ff;
case 33: // CPUE = a V exp(bV)
puec = par[0] * vba * Math.exp(par[1] * vba);
break;
case 15:
case 14: // CPUE=a+b.V+c.(a+b.V)^2.E MODELE CAPTURABILITE
puec = par[0] + par[1] * vv + par[2] * (par[0] + par[1] * vv) * (par[0] + par[1] * vba) * ff;
break;
case 15: // CPUE=a.V^b+c.V^(2.b).E MODELE CAPTURABILITE
tmp1 = Math.pow(vv, par[1]);
tmp2 = Math.pow(vba, par[1]);
puec = par[0] * tmp1 + par[2] * tmp1 * tmp2 * ff;
break;
case 16:
case 16: // CPUE=a.V+b.V^2.E MODELE CAPTURABILITE
puec = par[0] * vv + par[1] * vv * vba * ff;
break;
case 17:
case 17: // CPUE=a.V^b.exp(c.E.V^b) MODELE CAPTURABILITE
tmp1 = Math.pow(vv, par[1]);
tmp2 = Math.pow(vba, par[1]);
puec = par[0] * tmp1 * Math.exp(par[2] * tmp2 * ff);
break;
case 18:
case 18: // CPUE=(a+b.V).exp(c.(a+b.V).E) MODELE CAPTURABILITE
puec = (par[0] + par[1] * vv)
* Math.exp(-par[2] * (par[0] + par[1] * vba) * ff);
* Math.exp(+par[2] * (par[0] + par[1] * vba) * ff);
break;
case 19:
case 19: // CPUE=a.V.exp(b.V.E) MODELE CAPTURABILITE
puec = par[0] * vv * Math.exp(par[1] * vba * ff);
break;
case 20:
case 20: // CPUE=a.exp(b.E)+c.V+d MODELE ABONDANCE
puec = par[0] * Math.exp(par[1] * ff) + par[2] * vba + par[3];
break;
case 21:
case 21: // CPUE=(a.V+b.V^2).exp(c.E) MODELE ABONDANCE
puec = (par[0] * vba + par[1] * (vba * vba)) * Math.exp(par[2] * ff);
break;
case 22:
tmp = par[0] * Math.pow(vba, par[1]) + par[2] * ff;
case 22: // CPUE=((a.V^b)+d.E)^(1/(c-1)) avant ((a.V^b)+c.E)^(1/(d-1)). MODIF 2020.
tmp = par[0] * Math.pow(vba, par[1]) + par[3] * ff;
if (tmp > 0) {
puec = Math.pow(tmp, 1.0 / (par[3] - 1));
puec = Math.pow(tmp, 1.0 / (par[2] - 1));
} else {
puec = -Math.pow(-tmp, 1.0 / (par[3] - 1));
puec = -Math.pow(-tmp, 1.0 / (par[2] - 1));
}
break;
case 23:
case 23: // CPUE = ((a.V+b.V^2)^(c-1)+d.E)^(1/(c-1)) avant ((a.V+b.V^2)^(d-1)+c.E)^(1/(d-1)) MODELE ABONDANCE
tmp = par[0] * vba + par[1] * (vba * vba);
if (tmp > 0) {
tmp = Math.pow(tmp, par[3] - 1) + par[2] * ff;
tmp = Math.pow(tmp, par[2] - 1) + par[3] * ff;
} else {
tmp = -Math.pow(-tmp, par[3] - 1) + par[2] * ff;
tmp = -Math.pow(-tmp, par[2] - 1) + par[3] * ff;
}
if (tmp > 0) {
puec = Math.pow(tmp, 1. / (par[3] - 1));
puec = Math.pow(tmp, 1. / (par[2] - 1));
} else {
puec = -Math.pow(-tmp, 1. / (par[3] - 1));
puec = -Math.pow(-tmp, 1. / (par[2] - 1));
}
break;
case 24:
case 24: // CPUE=a.V.(b-c.V)+d.V^2.(b-c.V)^2.E MODELE CAPTURABILITE
tmp = par[1] - par[2] * vv;
puec = par[0] * vv * tmp
- par[3] * vv * vba * tmp * (par[1] - par[2] * vba) * ff;
+ par[3] * vv * vba * tmp * (par[1] - par[2] * vba) * ff;
break;
case 25:
case 25: // CPUE=a.V.(1+b.V).exp(c.V.(1+b.V).E) MODELE CAPTURABILITE
puec = par[0] * vv * (1 + par[1] * vv) * Math.exp(par[2] * vba * (1 + par[1] * vba) * ff);
break;
case 26:
case 26: // CPUE=a.V^(b+c)+d.V^(2.b).E MODELE CAPTURABILITE + ABONDANCE
tmp1 = Math.sqrt(vba * vv);
puec = par[0] * Math.pow(tmp1, par[1] + par[2]) + par[3] * Math.pow(vba, 2 * par[1]) * ff;
break;
case 27:
case 27: // CPUE=a.V^(1+b)+c.V^(2+b)+d.V^(2.b).E MODELE LINEAIRE QUADRATIQUE CAPTURABILITE + ABONDANCE.
tmp1 = Math.pow(vv, par[1]);
tmp2 = Math.pow(vba, par[1]);
puec = par[0] * tmp1 * vba + par[2] * (vba * vba) * tmp1 + par[3] * tmp1 * tmp2 * ff;
puec = par[0] * tmp1 * vba + par[2] * (vba * vba) * tmp1 + par[3] * tmp1 * tmp2 * ff; // OK
break;
case 28:
case 28: // CPUE=a.V^b.exp(c.V^d.E) MODELE ABONDANCE
puec = par[0] * Math.pow(vba, par[1]) * Math.exp(par[2] * Math.pow(vba, par[3]) * ff);
break;
case 29:
case 29: // CPUE=a.V^b.exp(c.V^d.E) MODELE CAPTURABILITE + ABONDANCE
tmp1 = Math.sqrt(vba * vv);
puec = par[0] * Math.pow(tmp1, par[1]) * Math.exp(par[2] * Math.pow(vba, par[3]) * ff);
break;
case 30:
case 30: // CPUE=(a.V^(1+b)+c.V^(2+b)).exp(d.V^b.E) MODELE CAPTURABILITE + ABONDANCE EXP. QUADRATIQUE
tmp1 = Math.pow(vv, par[1]);
tmp2 = Math.pow(vba, par[1]);
puec = (par[1] * tmp1 * vba + par[0] * tmp1 * (vba * vba)) * Math.exp(par[3] * tmp2 * ff);
// AVANT: puec = (par[1] * tmp1 * vba + par[0] * tmp1 * (vba * vba)) * Math.exp(par[3] * tmp2 * ff);
puec = (par[0] * tmp1 * vba + par[2] * (vba * vba) * tmp1) * Math.exp(par[3] * tmp2 * ff);
break;
}
return (puec);
}
static public double minimum_fonction(double vv, double par[]) {
double ff = 0, aa, bb, cc;
static public double minimum_fonction(double vv, double par[]) { // En fait il s'agit de la valeur maximale de E(ff) de la fonction Y=f(E) ou Y=f(E,V)
double ff = 0, aa, bb, cc; // On calcule donc la valeur de E(ff) qui annule la dérivée de la fonction Y.
int numeromod = Global.numero_modele;
switch (numeromod) {
case 0:
case 0: // CPUE=a+b.E
ff = -0.5 * par[0] / par[1];
break;
case 1:
case 1: // CPUE=a.exp(b.E)
ff = -1.0 / par[1];
break;
case 2:
case 2: // CPUE=a+b.V
ff = 0;
break;
case 3:
case 3: // CPUE=a+b.V
ff = 0;
break;
case 4:
case 4: // CPUE=a+b.V^c
ff = 0;
break;
case 5:
case 5: // CPUE=a+b.V+c.V^2
ff = 0;
break;
case 6:
case 6: // CPUE=(a+b.E)^(1/(c-1))
ff = -par[0] * (par[2] - 1) / (par[1] * par[2]);
break;
case 7:
case 7: // CPUE=a.V^b+c.E
ff = -0.5 * par[0] * Math.pow(vv, par[1]) / par[2];
break;
case 8:
case 34: // CPUE=a.V.exp(b.V)+c.E
ff = - 0.5 * par[0] * vv * Math.exp(par[1]*vv)/ par[2]; // ff = - par[0] * vv * Math.exp(par[1]*vv)/ 2 * par[2];
break;
/*case 35: // CPUE=a+b.V.exp(c.V)+d.E (Idem modèle 34 CPUE=a.V.exp(b.V)+c.E mais avec constante. Ajustement pas toujours réaliste, bénéfice minime, paramètre 'a' souvent non significatif. Parfois pb d'ajustement (ne converge pas ou MSY et MSE remarquables = 0 ou < 0.
ff = -0.5 * (par[1]* vv * Math.exp(par[2]*vv))/ par[3];
break; */
case 8: // CPUE=a+b.V+c.E
ff = -0.5 * (par[0] + par[1] * vv) / par[2];
break;
case 9:
case 35: // CPUE=a.V.exp(b.V).exp(c.E)
ff = -1.0 / par[2];
break;
case 37: // CPUE=a.V.exp(b.V)+c.(aV.exp(b.V))^2).E // Capturabilité
ff = -1 /(2 * par[2] * par[0] * vv * Math.exp(par[1] * vv)); // ff = -0.5 * par[2] * par[0] * vv * Math.exp(par[1] * vv);
break;
case 36: // CPUE=a.V.exp(b.V).exp(c.V.exp(b.V).E)
ff = -1 /(par[2] * vv * Math.exp(par[1]*vv));
break;
/*case 38: // CPUE=a.V.exp(b.V).exp(c.V.exp(d.V).E) // ABONDANCE et MIXTE?
ff = -1 /(par[2] * vv * Math.exp(par[3]*vv));
break; */
case 9: // CPUE=a.V+b.E
ff = -0.5 * par[0] * vv / par[1];
break;
case 10:
case 10: // CPUE=a+b.V+c.V^2+d.E
ff = -0.5 * (par[0] + par[1] * vv + par[2] * (vv * vv)) / par[3];
break;
case 11:
case 11: // CPUE=a.V^b.exp(c.E)
ff = -1.0 / par[2];
break;
case 12:
case 12: // CPUE=(a+b.V).exp(c.E)
ff = -1.0 / par[2];
break;
case 13:
case 13: // CPUE=a.V.exp(b.E)
ff = -1.0 / par[1];
break;
case 14:
ff = 0.5 / (par[2] * (par[0] + par[1] * vv));
case 33: // CPUE = a V exp(bV)
ff = 0;
break;
case 14: // CPUE=a+b.V+c.(a+b.V)^2.E
ff = -0.5 / (par[2] * (par[0] + par[1] * vv));
break;
case 15:
case 15: // CPUE=a.V^b+c.V^(2.b).E MODELE CAPTURABILITE
ff = -0.5 * par[0] * Math.pow(vv, par[1]) / (par[2] * Math.pow(vv, par[1] * 2));
break;
case 16:
case 16: // CPUE=a.V+b.V^2.E MODELE CAPTURABILITE
ff = -0.5 * par[0] / (par[1] * vv);
break;
case 17:
case 17: // CPUE=a.V^b.exp(c.V^b.E) MODELE CAPTURABILITE
ff = -1.0 / (par[2] * Math.pow(vv, par[1]));
break;
case 18:
ff = 1.0 / (par[2] * (par[0] + par[1] * vv));
case 18: // CPUE=(a+b.V).exp(c.(a+b.V).E) MODELE CAPTURABILITE
ff = -1.0 / (par[2] * (par[0] + par[1] * vv));
break;
case 19:
case 19: // CPUE=a.V.exp(b.V.E) MODELE CAPTURABILITE
ff = -1.0 / (par[1] * vv);
break;
case 20:
case 20: // CPUE=a.exp(b.E)+c.V+d
ff = 0.0;
/*
aa = par[1];
......@@ -226,38 +269,37 @@ public class EquationModele {
ff = minimis2(f0,aa,bb,cc);
*/
break;
case 21:
case 21: // CPUE=(a.V+b.V^2).exp(c.E)
ff = -1.0 / par[2];
break;
case 22:
ff = -(par[0] * Math.pow(vv, par[1])) * (par[3] - 1) / (par[3] * par[2]);
case 22: // CPUE=((a.V^b)+d.E)^(1/(c-1))
ff = -(par[0] * Math.pow(vv, par[1])) * (par[2] - 1) / (par[3] * par[2]);
break;
case 23:
ff = -Math.pow(par[0] * vv + par[1] * (vv * vv), par[3] - 1) * (par[3] - 1) / (par[3] * par[2]);
case 23: // CPUE=((a.V+b.V^2)^(c-1)+d.E)^(1/(c-1))
ff = -Math.pow(par[0] * vv + par[1] * (vv * vv), par[2] - 1) * (par[2] - 1) / (par[3] * par[2]);
break;
case 24:
ff = 0.5 * par[0] / (par[3] * vv * (par[1] - par[2] * vv));
case 24: // CPUE=a.V.(b-c.V)+d.V^2.(b-c.V)^2.E
ff = 0.5 * par[0] / (-par[3] * vv * (par[1] - par[2] * vv));
break;
case 25:
case 25: // CPUE=a.V.(1+b.V).exp(c.V.(1+b.V).E)
ff = -1.0 / (par[2] * vv * (1 + par[1] * vv));
break;
case 26:
case 26: // CPUE=a.V^(b+c)+d.V^(2.b).E
ff = -0.5 * par[0] * Math.pow(vv, par[2] - par[1]) / par[3];
break;
case 27:
case 27: // CPUE=a.V^(1+b)+c.V^(2+b)+d.V^(2.b).E
ff = -0.5 * (par[0] + par[2] * vv) / (par[3] * Math.pow(vv, par[1]));