Web server for general purpose function fitting and report writing services

Frequently Asked Questions

  1. How to fit a straight line?
  2. What is the meaning of chi2?
  3. How can we consider the both x and y experimental errors in my fit?
  4. How can we manipulate the experimental data using the "Calculate" textfield?
  5. Is it possible to include arithmetic calculations in textfield and parameter textfields?
  6. I am fitting the function y=a/pow(x,p) and although I get reasonable fitting parameter values the plot is not generated?
  7. What is the difference between "Overwrite" and "Archive"?
  8. Do you need more HD space in your account?
  9. Is it possible to write more complex fitting functions?
  10. Is it possible to make a conditional fit to data subset?
  11. What are the meanings of "Value", "Min", "Max", "Error" in the parameters table?
  12. How can I convert a single column table in a table with 3 columns?
  13. How can I calculate a definite integral suing my data table?
  14. Answers:

    1. How to fit a straight line?

      1. Type your data in the form of 3 columns x (your independent variable), y (your dependent variable), and Ey (the experimental uncertainty of y)
      2. Choose your plot settings (or just choose "autoscaling")
        You might execute "Data Plot" to check your plotted data
      3. Choose the names of your independent and dependent variables (ex. x, y)
      4. Choose the names of your parameters (ex. slope: a; value at the origin: b
      5. Type the equation (in programing language C): y= a*x+b
      6. Compile your function. The layout of OneFit webform changes if the compilation has no errors, otherwise a "compiling error" will blink and you should check the "Log" file
      7. The layout will show you the "Data" field and next to it the parameters table will all parameters initialized to 1 and fixed. Choose which ones to free and fit
      8. You might also choose your own values for the fitting parameters and simulate the curves using those values with the "Plot" button

    2. What is the meaning of chi2?

      chi2 is calculated according to eq 15.1.5 of the book Numerical Recipes in C, Second Edition (1992) http://apps.nrbook.com/c/index.html and according to the CERN library MINUIT minimization routine applied to the χ2. For a good fit the value of this chi2 should be small. For a moderate good fit the value can be around the number of degrees of freedom (N_exp_points-M_fitting_parameters). The value of chi2 depends very much on the experimental error values of your dependent variable.
    3. How can consider the both x and y experimental errors in my fit?

      By default the fitteia Fitter module considers only the experimental error of you dependent variable (let us call it ey). If you want to include the experimental error of your independe variable (let us call it ex) you have to propagate the error of x to y. Consider a linear error propagation: ey=ey'+|df/dx|ex (or var_y = sqrt(var_y'^2+ (df/dx)^2 var_x^2) for statistical errors). You can use the model function y=f(x) or calculate the numerical derivative of your experimental data (caution when using this since the numerical derivative is subject to high frequency fluctuations!!). If your data has 4 columns x ex y ey, try this in the columns calculation text box:
      c1 c2 c3 c4 dc3/dc1
      c1 c3 sqrt(c4*c4+c5*c5*c2*c2)
    4. How can we manipulate the experimental data using the "Calculate" textfield?

      Check the "Calculate How to". Anyway, the columns are addressed by "c" followed by the order number (e.g. c1, c2, c3,...., designate col1, col2, col3,...). The data in the "Data" textfield is considered as a table and each line in "Calculate" textfield generates a new table that it is saved back in the "Data" textfield, that is used as a buffer. The columns of the new table are expressed by the arithmetic calculations involving the columns c1, c2, ... and/or the fitting parameter values (e.g. c2 c1 c3+c2 1.0) will generate a new table where columns 1 and 2 change order, new column 3 will get the result of previous col3+col2, and a new column with a common value 1 is added to the table).
    5. Is it possible to include arithmetic calculations in textfield and parameter textfields?

      Yes, you can include arithmetic calculations in almost all textfields. They are executed prior to any other operation.
    6. I am fitting the function y=a/pow(x,p) and although I get reasonable fitting parameter values the plot is not generated?

      Most probably your x axis includes the value "0" that produces a singularity in the y domain. Choose new x-axis limits.
    7. What is the difference between "Overwrite" and "Archive"?

      Overwrite and Archive perform different actions. Archive performs a "save as" and adds the date to the file name. These archives files can not be overwritten. "Overwite" overwrites the /folder_name/file_name file.
    8. Do you need more HD space in your account?

      Please send me an email to pedro.jose.sebastiao @ ist.utl.pt with your request and present a short justification.
    9. Is it possible to write more complex fitting functions?

      There are two levels of user privileges "unaffiliated" and "affiliated". The latter one is allowed to write arbitrary fitting functions using a enahanced fitting interface. You can send an email to pedro.jose.sebastiao @ ist.utl.pt asking for this level of privilege and a short justification.
    10. Is it possible to make a conditional fit to data subset?

      Yes. You can use reserved words "fitif" and "plotif" in special comment lines in the data textfield.
      For instance if you have a few hundreds or thousands of experimental points (x,y,ey) to fit but you want to perform first a fit of just a few ones (e.g. one every 20 points, if the x>0) you might use "# fitif c1>0,20". The instruction "# plotif c1>0,10" will do the same when you just want to plot fitting curves and the experimental data. "fitif" and "plotif" can be used in the same line as in "# fitif plotif c1>0,20". In the Tutorial folde you can find example "Basic-fitif" where you can test the effect of these directives.
    11. What are the meanings of "Value", "Min", "Max", "Error" in the parameters table?

      • The "Value" column contains the the initial parameters values used by the CERN library MINUIT minimization routine applied to the χ2 function of the fitting parameters.
      • "Min" and "Max" colmns contain the fitting parameters limits in the fitting parameters space where MINUIT tries to find the point where χ2 is minimum.
      • "Error" column contains the output fitting parameters errors calculated by the MINUIT routine.
    12. How can I convert a single column table in a table with 3 columns?

      In the fitter or plotter modules you can try to run (Calculate) the following lines in the columns operator text area (below the data text box):
      1. 1:1:30
      2. c1
      3. select 1:1:end/3, i c1 and i+end/3 c1 and i+2*end/3 c1
      the result should be a 3 columns table with 1 to 10 in the first column, 11 to 20 on the second and 21 to 30 on the third column.
    13. How can I calculate a definite integral using my data table?

      In the calculator box of plotter module (identical for the fitter module) you can type:
      0:0.01:1
      c1*2*pi
      c1 sin(c1)
      c1 c2 Ic2dc1

      You will get a 3 columns table angle, sin(angle), integral_0^sin(angle) dangle

      Click on split and check the result