jhplot.stat
Class StatShape

java.lang.Object
  extended by jhplot.stat.StatShape

public class StatShape
extends Object

Shape identification based on a linear regression It calculates eccentricities in the transverse and longitudinal directions, as well as the size of the objects. Used used for identification of statistical patterns. Data points can have weights.


Constructor Summary
StatShape(double[] x, double[] y, double[] w, int n)
          Perform a linear regression analysis with weights and prepare for a shape identification.
 
Method Summary
 void doc()
          Show online documentation.
 double[] getCenters(int k)
          Get the centers in non-quadrant method.
 double getChi2()
          Get Chi2 of this fit
 double[] getCovariance()
          Get covariance matrix.
 P1D getData()
          Get data back used for fitting (can be inverted in Y and Y for best results).
 F1D getFitFunction()
          Get a fit function after the linear regression (major axis).
 F1D getFitFunctionPerp()
          Get a fit function perpendicular to the linear regression line (minor axis).
 F1D[] getFitFunctionQuadrants()
          Get linear functions after rotation of major and minor axes by 45 deg to define the quadrants.
 double[] getFitParameters()
          Get fit parameters, the intercept (0) and the slope (1)
 double[] getFitParametersPerp()
          Get fit parameters of a function perpendicular (minor) axis to the linear regression line the intercept (0) and the slope (1)
 double[] getFitParametersRotate()
          Parameters after rotation of major and minor axes by 45deg.
 double[] getMeans()
          Get weighted means in X and Y
 double[] getSummary()
          Return all shape parameters
 void process(int choice)
          Process event.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatShape

public StatShape(double[] x,
                 double[] y,
                 double[] w,
                 int n)
Perform a linear regression analysis with weights and prepare for a shape identification.

Parameters:
x - array in x
y - array in y
w - weight of the data point
n - total number of points
Method Detail

getData

public P1D getData()
Get data back used for fitting (can be inverted in Y and Y for best results).


getChi2

public double getChi2()
Get Chi2 of this fit

Returns:

getCovariance

public double[] getCovariance()
Get covariance matrix. 0: cov_00, 1: cov_11, 2:cov_01

Returns:

process

public void process(int choice)
Process event. Perform all calculations of eccentricities, axis lengths, centers, etc.

Parameters:
option - option =0 use weighted linear regression and weighted means in quadrants =1 use unweighted linear regression and weighted means in quadrants =2 use unweighted calculations for everything

getFitParameters

public double[] getFitParameters()
Get fit parameters, the intercept (0) and the slope (1)

Returns:
array with intercept (index 0) and the slop (index 1)

getFitFunction

public F1D getFitFunction()
Get a fit function after the linear regression (major axis).

Returns:
fit function

getFitFunctionPerp

public F1D getFitFunctionPerp()
Get a fit function perpendicular to the linear regression line (minor axis).

Returns:
fit function

getFitParametersPerp

public double[] getFitParametersPerp()
Get fit parameters of a function perpendicular (minor) axis to the linear regression line the intercept (0) and the slope (1)

Returns:
array with intercept (index 0) and the slop (index 1)

getFitParametersRotate

public double[] getFitParametersRotate()
Parameters after rotation of major and minor axes by 45deg. To locate weighted centers in 4 quadrants first get new slopes


getFitFunctionQuadrants

public F1D[] getFitFunctionQuadrants()
Get linear functions after rotation of major and minor axes by 45 deg to define the quadrants.

Returns:
fit functions

getMeans

public double[] getMeans()
Get weighted means in X and Y

Returns:
array with weighted mean in X (index 0) and Y (index 1)

getCenters

public double[] getCenters(int k)
Get the centers in non-quadrant method. There should be 4 cluster centers separated by the major and minor vectors

Parameters:
k - current center centers (1,2,3,4)
Returns:
2D array with X and Y positions

getSummary

public double[] getSummary()
Return all shape parameters

Returns:
array with shape characteristics p[0] = majorLength; p[1] = minorLength; p[2] = 1 - minorLength / majorLength; p[3] = majorLength1; p[4] = majorLength2; p[5] = 1 - majorLength1 / majorLength2; p[6] = minorLength1; p[7] = minorLength2; p[8] = 1 - minorLength1 / minorLength2; p[9] = GlobalMajorLength; p[10] = GlobalMinorLength; p[11] = majorLength_meth2; p[12] = minorLength_meth2; p[13] = 1 - minorLength_meth2 / majorLength_meth2; p[14] = nq_majorLength; p[15] = nq_minorLength; p[16] = 1 - nq_minorLength / nq_majorLength; p[17] = nq_majorLength_meth2; p[18] = nq_minorLength_meth2; p[19] = 1 - nq_minorLength_meth2 / nq_majorLength_meth2; p[20] = 1 - nq_majorLength1 / nq_majorLength2; p[21] = 1 - nq_minorLength1 / nq_minorLength2; p[22] = Fmax;

doc

public void doc()
Show online documentation.



jHepWork 3.1 ©