winfit

  WinFit 1.4

WinFit  - A Non-Linear-Least-Squares Fitting program for windows 3.1

About WinFit

Features

Using WinFit

The Results

Method and Math

Menu

Windows

Revisions

Registration

Guarantee

Suggestions

DIGITIZE

WinNN


About WinFit

A general purpose Non Linear Weighted Least Squares Fitting program for windows 3.1

WinFit can load X, Y and STD(Y)  data from a file plot the data and fit it to several built in functions and a user define function.


Features

New to this version

• New User interface.

• Peak search can be used to find the initial parameters for multiple Gaussians and Lorenzians.

• WinFit now supports up to 22 parameters.

Other

• The fitting functions include:

- Multiple Lonrentzians.

- Multiple Gaussians.

- Multiple Exponentials.

- Sum of power laws.

- Polynoms.

- User Defined function

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

• Data fitting region can be selected from the plot.

• The data can be plotted with LOG axis options.

• User defined equations can be saved in the winfit.ini file.

• Parameters file can be save and restored.

• The program uses Levenberg-Marquardt fitting method.

• 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 22 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

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. The basic data file format is:

X Y STD(Y)

The delimiter between the numbers should be SPACE or TAB.

2. If your file is not simple (column 1 is X and Column 2 is Y). Before you open the file, use the Read Setup menu to specify the columns. The Y-error in your data 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 plot your data, 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 HIDE button to go back. When you select an equations the parameters windows will appear (a simple linear function is available 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 WinFit start fitting.

7. Click on the FIT button. You will find one in the main WinFit windows or on the PLOT or PARAMETERS windows.


Equations

Equations can be selected from the WinFit window. WinFit supports several built-in equations and user-defined equations. The built in equations are faster because the equations are coded to WINFIT.DLL and the analytical form of the derivative is used.

The user-defined equations are interpreted from left to right without the normal algebraic calculation order, therefore you must enforce the correct order by using parenthesis.

The equations can be save to the WINFIT.INI file. Use the ADD command in the Equation window to add a new equation. UPDATE to update a change in an equation and DELETE to delete an equation. You must also enter the number of parameters in the equation.


Plot

The plot windows has two main functions:

• Display the data and fit results.

• Help select the data range to be fitted. The data range can be selected by the scroll bars; lower and upper limits cab be set in this way.

The data and the fit can be plotted on LINEAR or LOG scale. The fitted curve is calculated by default at every data point the can be change by changing the number in the Fit Plot Points box, increasing this number will result in a smoother curve.


The Results

The results of the fits will appear in the parameter window with the standard deviation in 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 use the Read Setup menu to specify which column to read.

Read Setup

Sets the data file columns to read for the X, Y and STD(Y).

Save Report As

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

Open Param

Opens a parameter File (see Save Param As)

Save Param As

This command can save the fitting session. The data is saved to a text file in the following format:

1. Function number.

2. Number of terms in the equation.

3. The parameters.

4. The data file name.

5. The data columns to read.

6. The data range to be fitted.

7. Various flags of the plot options.

When a parameter file is restored, fitting the data with 1 iteration will generate the covariance matrix.

Exit

Exits WinFit


Paramenters
Parameters

Show

Displays the fit parameters, 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 data; X, Y, Y-Error and the fitted function; Y(x) and std(Y(x)).


Help

Help

Help for using WinFit

About

Details on WinFit


Windows

Plot

Parameters

Peak Search

View


Parameters Window

This windows allows the user the enter the fitted parameters initial guess and to view the fitted parameters and the reduced χ2.

Terms : Changes the number of terms in the equations. Works only with equations that supports this feature.

Vary ? : Selects if the parameter is varied during the fit or held constant.

STD% : Selects if the displayed parameter error is in percent of the STD.

Stay on Top : when enabled the window will always stay on top.

This forms also enables access to the Peak Search window. This is available for Gaussinas and Lorenzians functions.

You can use the Edit Copy menu command to copy the parameters to the windows clipboard.


View Windows

This windows will display the data and the fitted Y and error. You can also Copy the data to the windows clipboard to paste in another application.


Peak Search Window

This windows will be accessible via the Peaks menu in the Parameters Windows. The Peak Search utility was designed to search for peaks of valleys and setup the initial parameters for the peak.

Average Width: Enter the average peak width in the same units of the X axis.

Smoothing: Amount of data smoothing before the peaks search.

Peaks > Param: Converts the results to parameters that can be used in the fit.

It is best to try several settings of the Average Width and Smoothing, until the search yields the right number of peaks you are looking for. You can then plot the function and check it. If you have too many peaks or peaks in the wrong locations, you can go back to the Peak Search Window and select one or several peaks, and click on the Delete button to remove them.


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 in user defined equation).

Version 1.1

• Improve Interface

• New Help File

• Add small markers to Plot.

• Add registration code.

Version 1.2 May 1993

• Save user equations.

• Save and load parameter files, allows saving and restoring the fit session.

• Allow to fit a data region. using 'live' data selection from the plot.

• Improved plotting, parameters can now be printed on the plot.

• Data Reader; Read X,Y point from plot.

Version 1.22 May 1993

• Pressing the FIT button in any window will start the fit session.

Version 1.4 Feb. 1994

• New user interface.

• Support for more parameters.

• Add peak search.


Registration

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

register:

• Personal registration $25.

• Commercial registration $40.

A registered user will receive:

• A user code that resisters this version of WinFit.

• A disk with the latest version at the registration time.

• Unlimited number of updates. The user code will also work with future releases of WinFit. New versions will be posted to ftp.cica.indiana.edu.

To register print and fill this form or use the file REGISTER.WRI

__________________________________________________________________

Register:    ___ Personal Copies at $25 each.

                 ___ Commercial Copies at $40 each.

Total enclosed $ ____

Name:

_________________________________________________________________

Address:

_________________________________________________________________

_________________________________________________________________

_________________________________________________________________

_________________________________________________________________

Internet address: ____________________________________________________

User Name:	_______________________________________________________

(First and Last name for personal registration users)


Suggestions

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

danony@rpi.edu


Digitize

Also Available 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 VBRUN300.DLL, you would probably also need a scanner to scan your plots and save it as a bitmap file (BMP or PCX). Digitize also accepts bitmaps pasted from the clipboard.


WinNN

WinNN - Windows Neural Networks is a shareware windows neural networks simulator. WinNN can handle multi-layered feed forward networks and train using modified back propagation. WinNN has very  friendly user  interface and fast engine to run the calculations. WinNN can import data, train, plot and output the results.

WinNN was uploaded to ftp.cica.indiana.edu as winnn91.zip and was placed in the pub/pc/win3/programr directory.