WSTS Data-Fitting Software

Overview

This is a suite of programs to fit functions to discrete data. The programs are written in Java using the mathematical library and the cloud interface, and include:

These programs are high-integrity mathematical software. The standard production versions do not include graphics, for portability and to make it easier to run the programs as part of batch processes. However, the output is suitable for reading into most spreadsheets or programs such as GNUPLOT. Versions with built-in graphics are available for a restricted set of platforms - please enquire for more information.

Older versions written in C++ and Fortran may be available on request.

Executable programs (Java JAR file, $5.00, without supporting libraries):
Executable programs (Java JAR file, $50.00, including supporting libraries):
Source code (Java, without supporting libraries, $10.00):

1D polynomial fitting

Finds the best least-squares polynomial to fit data. The data may include weightings for each point.

The program calculates the fitting coefficients, the residual of the fit (sum of squares of deviation from each point), the determinant of the fitting equation (indicating when the fitting process may run into trouble if the problem is ill-conditioned) and the deviation in each point.

Here is an example of the results of polynomial fitting with and without weights, and plotted using GNUPLOT:

polynomial fitting graph

fit a linear combination of arbitrary functions

Finds the best least-squares fit of a set of arbitrary functions to data. The data may include weightings for each point. The value of each function at each data point is read in, so the functions may be calculated by any means whatsoever.

The program calculates the fitting coefficients, the residual of the fit (sum of squares of deviation from each point), the determinant of the fitting equation (indicating when the fitting process may run into trouble if the problem is ill-conditioned) and the deviation in each point.

fit a (hyper)plane to data

Finds the best least-squares fit of a hyperplane to a set of data. The data may include weightings for each point.

The program calculates the parameters of the plane (its normal vector and family parameter) and the deviation of each data point from the fit. The program operates in any number of space dimensions.

For an animated example of the results of the fitting program, plotted using GNUPLOT, click here (184 kb).

fit a (hyper)sphere to data

Finds the best least-squares fit of a hypersphere to a set of points, by solving a matrix equation rather than simply averaging points. The data may include weightings for each point.

The program calculates the parameters of the sphere (its centre and radius), and operates in any number of space dimensions.

fit a (hyper)ellipsoid to data

Finds the best least-squares fit of a hyperellipsoid to a set of points. The data may include weightings for each point.

The program calculates the parameters of the ellipsoid (its centre and half-axes), and operates in any number of space dimensions. The principal axes of the ellipsoid are parallel with the coordinate directions.

The centre of the ellipsoid may be defined by the user, or calculated by a (weighted) average of the points.

fit a general (hyper)ellipsoid to data

Finds the best least-squares fit of a general hyperellipsoid - where the principal axes may point in any direction - to a set of points. The data may include weightings for each point. The axes must be chosen by the user.

The program calculates the parameters of the ellipsoid (its centre and half-axes), and operates in any number of space dimensions. The half-axes are expressed in terms of the axis vectors: if these are not unit vectors then the half-axes will vary with the length chosen.

The centre of the ellipsoid may be defined by the user, or calculated by a (weighted) average of the points.