Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/05/15 16:09:10 (9 years ago)
Author:
ascheibe
Message:

#2031 implemented review comments

Location:
trunk/sources/HeuristicLab.Analysis/3.3/Statistics/Fitting
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis/3.3/Statistics/Fitting/ExpFitting.cs

    r11913 r11914  
    2525namespace HeuristicLab.Analysis.Statistics {
    2626  public class ExpFitting : IFitting {
    27     private void LogFunc(double[] c, double[] x, ref double func, object obj) {
     27    private void ExpFunc(double[] c, double[] x, ref double func, object obj) {
    2828      func = Math.Exp(-c[0] * Math.Pow(x[0], 2));
    2929    }
     
    3434    }
    3535
    36     public void Calculate(double[] dataPoints, out double p0, out double p1) {
     36    public void Calculate(double[] dataPoints, out double p0) {
    3737      var stdX = GetDefaultXValues(dataPoints.Count());
    38       Calculate(dataPoints, stdX, out p0, out p1);
     38      Calculate(dataPoints, stdX, out p0);
    3939    }
    4040
    41     public void Calculate(double[] y, double[] x, out double p0, out double p1) {
     41    public void Calculate(double[] y, double[] x, out double p0) {
    4242      if (y.Count() != x.Count()) {
    4343        throw new ArgumentException("The lenght of x and y needs do be equal. ");
     
    6060      alglib.lsfitcreatef(xx, y, c, diffstep, out state);
    6161      alglib.lsfitsetcond(state, epsf, epsx, maxits);
    62       alglib.lsfitfit(state, LogFunc, null, null);
     62      alglib.lsfitfit(state, ExpFunc, null, null);
    6363      alglib.lsfitresults(state, out info, out c, out rep);
    6464
    6565      p0 = c[0];
    66       p1 = c[0];
    6766    }
    6867
    69     public DataRow CalculateFittedLine(double[] dataPoints, string rowName) {
    70       DataRow newRow = new DataRow(rowName);
    71       double c0, c1;
    72       Calculate(dataPoints, out c0, out c1);
     68    public DataRow CalculateFittedLine(double[] dataPoints) {
     69      DataRow newRow = new DataRow();
     70      double c0;
     71      Calculate(dataPoints, out c0);
    7372      var stdX = GetDefaultXValues(dataPoints.Count());
    7473
     
    8079    }
    8180
    82     public DataRow CalculateFittedLine(double[] y, double[] x, string rowName) {
    83       DataRow newRow = new DataRow(rowName);
    84       double c0, c1;
    85       Calculate(y, x, out c0, out c1);
     81    public DataRow CalculateFittedLine(double[] y, double[] x) {
     82      DataRow newRow = new DataRow();
     83      double c0;
     84      Calculate(y, x, out c0);
    8685
    8786      for (int i = 0; i < x.Count(); i++) {
Note: See TracChangeset for help on using the changeset viewer.