corina.cross
Class TScore

java.lang.Object
  |
  +--corina.cross.Cross
        |
        +--corina.cross.TScore
All Implemented Interfaces:
Runnable

public class TScore
extends Cross

A (Student's) T-Score crossdate.

This algorithm is based on Mecki Pohl's algorithm, and gives very similar results (reason for deviations unknown, possibly rounding error). I'm not completely certain this implementation is correct, but it gives usable results. Corrections welcome.

There are apparently many (dozens of?) T-score algorithms in existance. This one is taken from Baillie and Pilcher's "A Simple Crossdating Program", pp. 7-14, Tree-Ring Bulletin, Vol. 33, 1973. That version was "written in FORTRAN IV and uses a card reader and line printer".

The procedure used is as follows:

  1. Normalize the data (make it "bivariate-normal"):
  2. For each possible overlap, compute the r (correlation coefficient):
  3. s1 = Σ ( xiyi - N ( xi - xavg ) ( yi - yavg ) )
    s2 = Σ ( xi2 - N ( xi - xavg )2 )
    s3 = Σ ( yi2 - N ( yi - yavg )2 )
    r = s1 / √( s2 s3 )
  4. Compute the t-score:
  5. t = r √( (N - 2) / (1 - r2) )

This class is dedicated to poor Mr. Potter out in Van Nuys.

Version:
$Id: TScore.java,v 1.4 2002/10/29 17:29:56 bitpoet Exp $
Author:
Ken Harris

Fields inherited from class corina.cross.Cross
data, fixed, highScores, moving, msg
 
Constructor Summary
protected TScore()
           
  TScore(Sample s1, Sample s2)
          Construct a new T-score from two samples.
 
Method Summary
 double compute(int offsetFixed, int offsetMoving)
          Given offsets into the fixed and moving data, compute a single T-score for that position.
 String getFormat()
          A format string for T-scores.
 double getMinimumSignificant()
           
 String getName()
          Return a prettier name for this cross: "T-Score".
 boolean isSignificant(double score, int overlap)
           
protected  void preamble()
          Preamble: copy all data to (mutable) float arrays, normalize the data, and compute means of the series.
 
Methods inherited from class corina.cross.Cross
getFixed, getMinimumOverlap, getMoving, isFinished, run, single, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TScore

protected TScore()

TScore

public TScore(Sample s1,
              Sample s2)
Construct a new T-score from two samples.
Parameters:
s1 - the fixed sample
s2 - the moving sample
Method Detail

getName

public String getName()
Return a prettier name for this cross: "T-Score".
Overrides:
getName in class Cross
Returns:
the name of this cross, "T-Score"

getFormat

public String getFormat()
A format string for T-scores.
Overrides:
getFormat in class Cross
Returns:
a format string for T-scores

isSignificant

public boolean isSignificant(double score,
                             int overlap)
Overrides:
isSignificant in class Cross

getMinimumSignificant

public double getMinimumSignificant()
Overrides:
getMinimumSignificant in class Cross

compute

public double compute(int offsetFixed,
                      int offsetMoving)
Given offsets into the fixed and moving data, compute a single T-score for that position.
Overrides:
compute in class Cross
Returns:
the T-score for this possible cross

preamble

protected void preamble()
Preamble: copy all data to (mutable) float arrays, normalize the data, and compute means of the series.
Overrides:
preamble in class Cross