Package corina.index

The corina.index package contains algorithms for indexing (de-trending) data.

See:
          Description

Interface Summary
Solver.Solveable A basis function for fitting data points to, using least-squares.
 

Class Summary
CubicSpline A cubic spline index.
Exponential An exponential curve fit.
Floating A floating (previously misnamed "floating-point") index; each point on the index is the mean of some number of data points (the window) around that data point.
HighPass A simple high-pass filter.
Horizontal Horizontal-line index type.
Index Abstract representation of an index of a Sample.
IndexDialog Indexing dialog.
IndexDialog.DecimalRenderer  
IndexDialog2  
IndexSet Run a set of Indexes on a single Sample.
Polynomial A polynomial-fit index to a data sample.
Solver A collection of matrix solvers.
 

Exception Summary
Solver.SingularMatrixException In case an operation is passed a singular matrix.
 

Package corina.index Description

The corina.index package contains algorithms for indexing (de-trending) data. They are easily runnable as Threads (they implement Runnable), but most samples are probably too short and most computers too fast for this to be really necessary. They also are Graphable, so the user can visually compare indexes.

How to use in an application

A single Index is straightforward to use:

Index i = new Floating(mySample);		// create the index
System.out.println("Running index:" + i);	// print the name
i.run();					// run the computation
System.out.println("chi^2 = " + i.getChi2());	// print chi^2 value
i.apply();					// apply to mySample
Because Indexes are Graphable, an application will usually give the user the option to view the graph after running it, but before applying it.

Since they're Runnable, you can also run it in a separate thread:

Thread t = new Thread(new Exponential(mySample));
t.start();
But this probably isn't necessary, unless you're on a slow computer or want the interface to be highly responsive.

Usually, the user will want to see many different possible indexes, and choose one. For this, IndexSet is provided. It will run a group of common indexes. The application can then display them all (in a table, for example):

IndexSet is = new IndexSet(mySample);	// create an IndexSet
is.run();				// IndexSet is also Runnable
for (int i=0; i<is.indexes.size(); i++) {	// print each, along with chi^2
    Index x = (Index) is.indexes.get(i);
    System.out.println(x + ", chi^2 = " + x.getChi2());
}

How to add a new indexing algorithm

To create a new indexing algorithm, just subclass Index. There are only 3 methods you need to deal with:

To use it, you'll probably want to add it to IndexSet.

Be sure to write Javadoc for the Index, including what the algorithm is and where it came from, and update the IndexSet Javadoc, if you add it there.