winfit

 WinFit 1.1

WinFit 1.1 - A Non-Linear-Least-Squars Fitting program for windows 3.1

About WinFit

Features

Using WinFit

The Results

Method and Math

Menu

Revisions

Registration

Guarantee

Suggestions

DIGITIZE


About WinFit

A general purpose Non Linear Weighted Least Squares Fitting program for windows 3.x

The program can load X, Y, Error data from a file plot the data and fit it to several built in functions and to a user define function.


Features

 Reads a simple ASCII file, space or tab delimited of X Y with an optional Y-error data.

 The data can be plotted with log axis options.

 The program uses Levenberg-Marquardt fitting method.

 There are some built in functions and the a user-defined function.

 The program can generate weights that improve fitting performance for some problems.

 This version can read up to 5000 data points and fit up to 10 parameters.

 The program provides a REPORT file and the plot can be copied to the clipboard.

 The program will calculate and display the COVARIANCE and CURVATURE matrixes


Using WinFit

In order to use a non linear fitting algorithm the user must start the fitting session with an

initial guess for the parameters to be fitted. If this guess is good enough the program will

converge to a "good" fit.

1. Prepare your data file (with notepad for example) and save it with .DAT extension. Open the file with the  File Open menu command. A sample data file FIT.DAT is provided with the program.

2. If your file is not simple (column 1 is X and Column 2 is Y) specify the columns in the FIle Open window also specify the Y-error column. The Y-error should represent one standard deviation in the value of  Y.

3. As an indication that the file was read correctly you should check the No. of Points in the WinFit window, it will show the number of data points in your file.

4 You are ready to view your data so you can click the PLOT button. You can also view the numbers with the Data View menu.

5. Next select an equation from the WinFit window, if you are in the PLOT window click the FIT window to go back. As you Select an equations the Parameters windows will appear ( a simple linear function is provided as a test to be used with the file FIT.DAT).

6. Change the initial parameters and click the PLOT button. Repeat that process until you see the fitted curve plotted with your data. This should provide a good initial guess for the program to start fitting.

7. From the WinFit window click the FIT button.


The Results

The results of the fits will appear in the parameter window with the standard deviation of each parameter. During the fitting process the message window will give information about the fitting process. An iteration starting with a + (plus) sign is a successful iteration (the chi-square was minimized).

The program will iterate until the number of iterations is equal to the number in the Max iteration box (you can change this number) or the %-Error is equal or less then value in the Chisq % Error box (you can change this value).

The COVARIANCE and CURVATURE Matrixes can be viewed by choosing this option in the Prameters menu.


Methods and Math

1. The chi-square is calculated as chisq=sum((Y(xi)-Yi)/sigYi)**2)   for i=1 to N

where	N is the number of data points

Y(xi) is the fitted curve value at xi

Yi is the Y value for data point i

sigYi is the standard deviation in Yi

2. The reduced chisq is defined by rchisq=chisq/(N-Nfit)

where Nfit is the number of fitted parameters. (parameters that are kept variable during the fit).

3. The Percent Error in chi-square is Defined:

%Error=100(1-chisq/ochisq) where ochisq is the value of chi-square in the previous iteration.

4. In Some problems a better fit is obtained if the data is weighted. A simple way for generate the weights (if they are not available in the data file) is to use the Data menu and choose Set Weights this will set the value of  sigYi (see note 1).


Guarantee

None, the author is not responsible to any damage that may be caused by the program or by the use of the program results. The responsibility is of the user alone.


Menu

File

Parameters

Data

Help


File

Open Data

This menu will prompt you for the ASCII file name where the X,Y data is stored. The file should be organized columns of X, Y or X,Y and the Y-Error. The numbers could be  delimited by tab or space. If the file contains more than 3 columns, by default WinFit will read only the first 2 , however you can specify the which column is the X, Y or Y-Error.

Save Report As

Save a report of the fit parameters in a text file.

Exit

Exits WinFit


Paramenters

Show

Displays the fit parameters form, you must select an equation first.

View Covariance Matrix

Displays the covariance matrix obtained from the fit. The elements on the diagonal are the

variances in each fitted parameter.

View Curvature Matrix

Displays the Curvature matrix.


Data

Set Weights

Allows to set the weights as a simple power function of the Y values; W=A*Y**B This can help in some fitting problems to force the fit to a specific region of the un-weighted data.

View

Displays the X, Y, Y-Error and the Y(x) which is the fitted-Y value.


Help

Help

Help for using WinFit

About

Details on WinFit


Revisions

Version 0.99

 First release

Version 1.0

 3D-look

Versions 1.0a, 1.0b

 Fix Various bugs and reduce DLL Size (minor speed improvements is user defined equation).

Version 1.1

 Improve Interface

 New Help File

 Add small markers to Plot.

 Add registration code.


Registration

If you use WinFit for more than 30 days (or you liked it much sooner) you should

register it by sending $15 to:

Yaron Danon

14 Beman Lane

Troy, NY 12180

A registered user will receive a user code that resisters this version of WinFit. This user code will also work with future releases of WinFit.  This enables the registered user to download any future release of WinFit and register it without any communication with the author. This gives the user a fast way of updating WinFit.


Suggestions

Suggestions and comments are welcomed and can be E-Mail to:

Danony@rpi.edu


Digitize

Also Avilable is Digitize:

Digitize is an Un-Graphing program, it can import a scanned X,Y plot and digitize it to end up with a text file (or clipboard data) containing the X,Y points.

This program is written in Visual Basic so you need the VBRUN200.DLL, you would probably also need a scanner to scan your plots and save it as a bitmap file (BMPor PCX). Digitize also accepts bitmaps pasted from the clipboard.