net.talvi.puffinplot.data
Class PcaValues

java.lang.Object
  extended by net.talvi.puffinplot.data.PcaValues

public class PcaValues
extends java.lang.Object

This class performs three-dimension principal component analysis on a supplied collection of vectors and stores the results.

See Also:
PcaAnnotated

Method Summary
static PcaValues calculate(java.util.List<Vec3> points, boolean anchored)
          Performs principal component analysis (PCA) on the supplied vectors and returns an object containing the results of the analysis.
 Vec3 getDirection()
          Returns the direction of the principal PCA axis.
 java.lang.String getEquation()
          Return a Cartesian equation describing the PCA line.
static java.util.List<java.lang.String> getHeaders()
          Returns the headers describing the parameters as a list of strings.
 double getMad1()
          Returns the maximum angle of planar deviation.
 double getMad3()
          Returns the maximum angle of linear deviation.
 Vec3 getOrigin()
          Returns the origin for the PCA fit.
 boolean isAnchored()
          Reports whether the PCA calculation was anchored.
 java.util.List<java.lang.String> toStrings()
          Returns the parameters as a list of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

calculate

public static PcaValues calculate(java.util.List<Vec3> points,
                                  boolean anchored)
Performs principal component analysis (PCA) on the supplied vectors and returns an object containing the results of the analysis.

Parameters:
points - the points upon which to perform PCA
anchored - true to anchor the PCA to the origin
Returns:
the results of the PCA

getMad1

public double getMad1()
Returns the maximum angle of planar deviation. This is defined by Kirschvink (1980) p. 703.

Returns:
the maximum angle of planar deviation

getMad3

public double getMad3()
Returns the maximum angle of linear deviation. This is defined by Kirschvink (1980) p. 703.

Returns:
the maximum angle of linear deviation

getOrigin

public Vec3 getOrigin()
Returns the origin for the PCA fit. If this is an anchored PCA fit, this will be the zero vector, the origin for the co-ordinate system. Otherwise it will be the centre of mass of the points.

Returns:
the origin for the PCA fit

getDirection

public Vec3 getDirection()
Returns the direction of the principal PCA axis.

Returns:
the direction of the principal PCA axis

isAnchored

public boolean isAnchored()
Reports whether the PCA calculation was anchored.

Returns:
true is the PCA calculation was anchored

getHeaders

public static java.util.List<java.lang.String> getHeaders()
Returns the headers describing the parameters as a list of strings.

Returns:
the headers describing the parameters

getEquation

public java.lang.String getEquation()
Return a Cartesian equation describing the PCA line.

Returns:
a String giving an equation for the PCA line

toStrings

public java.util.List<java.lang.String> toStrings()
Returns the parameters as a list of strings. The order of the parameters is the same as the order of the headers provided by getHeaders().

Returns:
the parameters as a list of strings