 previous
previous
 home
home
Constrained 2 dimensional function model fitting
You can fit an arbitrary constrained function model f(x,y)=0 to a data set including errors in both the abscissa(x) and the ordinate(y) data. To start, click "2D Constrained Fit" tab on the application.
If you use the sample data,
click here, and save it
in the appropriate directory (or folder).
When you fit a function (in this case, a Lorentzian function) to the sample data,
- Click "Open data file", and specify the data file
  prepared according to the above instruction.
- When clicking the "Plot" button bellow, the plot is displayed. 
- When clicking the "Fit" button in the plot window, a result of the
  fitting is displayed.
Data
- Each label for data can be set in the first row in the data file. The label can not include spaces. Each label has to be delimited by space or tab.
- Data must be inputted by normal width.
- Data must be inputted in the data file corresponding to the
  following combinations of the data type for x and y.
- When the data type is "Gaussian-Gaussian" combination (x and y
  follow Gaussian distributions, respectively), the data must be inputted in
  order of x,
  the error of x ( ), y and the error of
  y ( ), y and the error of
  y ( ) which are
  delimited by space or tab. Change the line, and input the data of the following
  row similarly until the input of the last data ends. ) which are
  delimited by space or tab. Change the line, and input the data of the following
  row similarly until the input of the last data ends.
| x1  |    | y1  |  |  | x2  |    | y2  |  |  | . | . | . | . |  | . | . | . | . |  | . | . | . | . |  | xn  |    | yn  |  |  
 
- When the data type is "Gaussian-Poisson" combination (x follow 
  Gaussian distributions and y Poisson distributions), the data
  must be inputted in order of x,
  the error of x ( ) and y which are
  delimited by space or tab. The errors of y ( ) and y which are
  delimited by space or tab. The errors of y ( ) correspond to the square root of the
  values of y ( ) correspond to the square root of the
  values of y ( ). Change the line, and input the data of the following row similarly until the input of the last data ends. ). Change the line, and input the data of the following row similarly until the input of the last data ends.
| x1  |    | y1  |  | x2  |    | y2  |  | . | . | . |  | . | . | . |  | . | . | . |  | xn  |    | yn  |  
 
- When the data type is "Poisson-Gaussian" combination (x follow
  Poisson distributions and y Gaussian distributions), the data
  must be inputted in order of x,
  y and the error of y ( ) which are
  delimited by space or tab. The errors of x ( ) which are
  delimited by space or tab. The errors of x ( ) correspond to the square root of the
  values of x ( ) correspond to the square root of the
  values of x ( ). Change the line, and input the data of
  the following row similarly until the input of the last data ends. ). Change the line, and input the data of
  the following row similarly until the input of the last data ends.
| x1  | y1  |  |  | x2  | y2  |  |  | . | . | . |  | . | . | . |  | . | . | . |  | xn  | yn  |  |  
 
- When the data type is "Poisson-Poisson" combination (both x and y
  follow Poisson distributions, respectively), the data must be
  inputted in order of x and y which are
  delimited by space or tab. The errors of x ( ) correspond to the square root of the
  values of x ( ) correspond to the square root of the
  values of x ( ). The errors of y
  ( ). The errors of y
  ( ) correspond to the square root of the values of y ( ) correspond to the square root of the values of y ( ). Change the line, and input the data of
  the following row similarly until the input of the last data ends. ). Change the line, and input the data of
  the following row similarly until the input of the last data ends.
| x1  | y1 |  | x2  | y2 |  | . | . |  | . | . |  | . | . |  | xn  | yn |  
 
 
- In addition, you can use the table data form in the data file. You may
  include the column data in the data file which are not used to fit.
  In that case, the specification of the columns in the data file used to fit is needed at the line "Data columns" in the following "Input" instruction. 
Inputs
- Click "Open data file", and specify the data
  file prepared according to the above instruction.
- When the labels for data are used, check the "Data labels".
- The columns in the data file to be used to fit a function model
  can be specified at the line "Data columns". For instance, in the case that the data type is "Gaussian-Gaussian"
  combination, when x are put in the third column, the error of x
  in the forth column, y in the fifth column and the error of y
  in the sixth column in the data file, specify "3 4 5 6", and check
  the "Data columns" box.
- The range for x axis in the plot can be specified at the line "Data range". In that case, specify the range for x axis (the numerical
  values must be delimited by space), and check the "x range" box. For instance,
  when you want to assume the range for x to be 0  x x 15, 
  specify "0 15", and check the "x range" box. 15, 
  specify "0 15", and check the "x range" box.
- The range for y axis in the plot can be specified at the line "Data range". In that case, specify the range for y axis (the numerical
  values must be delimited by space), and check the "y range" box. For instance,
  when you want to assume the range for x to be 0  y y 15, 
  specify "0 15", and check the "y range" box. 15, 
  specify "0 15", and check the "y range" box.
- Select the data type at the line "Data type" according to the combination of the x and y data type.
- The title of the graph can be specified at the line "Graph title". Click the "Set" button after describing it. 
- The label of the abscissa in the graph can be specified
  at the line "Label of abscissa". Click the "Set" button after describing it. 
- The label of the ordinate in the graph can be specified
  at the line "Label of ordinate". Click the "Set" button after describing it. 
- The explanatory note (legend) of the data can be specified at the
  line "Legend of data". Click the "Set" button after describing it. 
Outputs
- The plot can be displayed when the "Plot" button is
  clicked.
- A summary of the plot can also be displayed when the "Show data summary" button is clicked.
Fitting a function to data
- Input a function model at the line "Function f(x,y)", and click the "Set"
  button. The input of the function must follow the form
  of f(x,y)=0. About the input of the function, refer here.
- This fitting algorithm requires the specification of initial values
  of the parameters included in the function model. Then, you must input the initial values of the parameters at the line "Parameters" which must be delimited by space, and click the "Set" button. 
- The range for x data to be fitted can be specified at the line "x
  data range". In that case, specify the range for x axis (the numerical
  values must be delimited by space), and check the "x data range" box. For instance,
  when you want to assume the range for x to be 0  x x 15, 
  specify "0 15", and check the "x data range" box. 15, 
  specify "0 15", and check the "x data range" box.
- Like the range for x data, the range for y data to be fitted can be specified at the line "y data range". In that case,
  specify the
  range for y in the plot (the minimum and the maximum values
  must be delimited by space), and check the "y data range". For instance,
  when you want to assume the range for y in the histogram to be 0  y y 15, 
  specify "0 15", and check the "y data range". 15, 
  specify "0 15", and check the "y data range".
- The explanatory note (legend) of the function can be specified
  at the line "Legend". Click the "Set" button after describing it. 
- When you use the second order derivatives of the function with
  respect to the parameters in computation of the parameter's errors,
  check the "2nd order derivatives" box.
- A result of fitting can be displayed, when the "Fit" button is
  clicked, and the fitting function is also displayed on the graph.
- When the "Show error matrix" button is clicked, the elements of the
  error matrix is displayed. 
- When the "Show residual graph" button is clicked, the plot
  of the residuals is displayed in another window. 
- When the "Show residuals" button is clicked, the estimations of x
  and y, and their residuals are displayed.
Drawing a function represented by a parametric variable
You can draw a parametric function in the plot. About the function
represented by parametric variables, refer here.
- Input the parametric variable function for x at the line
  "parametric x", and click
  the "Set" button. Where the parameter name is x, and the constant name
  is p0 and p1, and so on.
- If the constants (p0, p1, etc) are included in the parametric
  variable function of x, input the values delimiting by space at the
  "constants for x", and click the "Set" button.
- Input the parametric variable function for y at the line "parametric y", and click
  the "Set" button. Where the parameter name is x, and the constant name
  is p0 and p1, and so on.
- If the constants (p0, p1, etc) are included in the parametric
  variable function of y, input the values delimiting by space at the
  "constants for y", and click the "Set" button.
- Specify the range for the parameter(parametric variable) x included in both the
  parametric variable functions of x and y at the "range of parameter"
  which the values must be delimited by space, and click the "Set" button.  (=3.14159...) can be specified as a unit other than the numerical value. For example, it can be specified as
  "2*pi", "1.5*pi", and so on. (=3.14159...) can be specified as a unit other than the numerical value. For example, it can be specified as
  "2*pi", "1.5*pi", and so on.
- Click the "Draw parametric function" button.
Kazushi Neichi
Department of Business Administration, Tohoku Gakuin University