Changeset 4223


Ignore:
Timestamp:
07/22/08 14:28:13 (12 years ago)
Author:
curtis
Message:

Don't allow 1-component exponential guesses to have negative tau.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/slim/GACurveFitter.java

    r4221 r4223  
    242242    if (degrees >= 1) { 
    243243      // TODO: Estimate c, factor it in below. 
    244        
     244 
    245245      double guessC = Double.MAX_VALUE; 
    246246      for (int i = 0; i < curveData.length; i++) { 
    247247        if (curveData[i] < guessC) guessC = curveData[i]; 
    248248      } 
    249        
    250249 
    251250      //double guessC = 0.0d; 
     
    275274      // but the actual data is far too noisy to do this. Instead, we'll just 
    276275      // do it for the first 5, which have the most data. 
    277       //for (int i = 0; i < curveData.length; i++) { 
     276      //for (int i = 0; i < curveData.length; i++) 
    278277      for(int i = 0; i < 5; i++) { 
    279278        if (curveData[i] > guessC) { 
     
    291290      curveEstimate[0][1] = exp; 
    292291      curveEstimate[0][2] = guessC; 
     292 
     293      // Fix bug where the estimate occasionally produces negative 
     294      // tau values. If this happens, we'll sort it out in iteration. 
     295      if (curveEstimate[0][1] <= 0) curveEstimate[0][1] = 1000; 
    293296    } 
    294297    if (degrees == 2) { 
     
    324327      double highA = 0.0d; 
    325328      double lowA = Double.MAX_VALUE; 
    326       //for (int i = 0; i < curveData.length; i++) { 
     329      //for (int i = 0; i < curveData.length; i++) 
    327330      for(int i = 0; i < 5; i++) { 
    328331        if (curveData[i] > guessC + 10) { 
     
    372375      num = 0.0; 
    373376      den = 0.0; 
    374       //for (int i = 0; i < lowValues.length; i++) { 
     377      //for (int i = 0; i < lowValues.length; i++) 
    375378      for(int i = 0; i < 5; i++) { 
    376379        if (lowValues[i][1] > guessC) { 
     
    399402      if(curveEstimate[0][1] <= 0) curveEstimate[0][1] = 2000; 
    400403      if(curveEstimate[1][1] <= 0) curveEstimate[1][1] = 800; 
    401        
    402  
    403404    } 
    404405 
Note: See TracChangeset for help on using the changeset viewer.