Class pmr.stat.Multivariate
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.stat.Multivariate

java.lang.Object
   |
   +----pmr.stat.Stat
           |
           +----pmr.stat.DrawableStat
                   |
                   +----pmr.stat.Multivariate

public class Multivariate
extends DrawableStat
Multivariate - Multivariate class

This class holds a RealMatrix consisting of ndata vectors of length mdim. (If your data is organised differently, you may need to transpose.) It's early days yet, but we are starting with cluster analysis and simple principal components. Some routines may also work with just an n*n distance matrix or correlation matrix - we'll have to see.

Author:
(C) P. Murray-Rust, 1996

Variable Index

 o AVLINK
 o CENTROID
 o CLINK
 o GOWER
 o MCQUITTY
 o SLINK
 o TABLE
display types
 o WARD
different clustering methods

Constructor Index

 o Multivariate()
creates it with default data arrays
 o Multivariate(RealMatrix)
creates a Multivariate data matrix (m columns, n rows of data)
 o Multivariate(RealSquareMatrix)
creates a asquare data matrix for distances

Method Index

 o display(Graphics)
used by the ScrollableTopLevel to paint the object, or can be used to draw the object to somewhere else.
 o display(Graphics, Component)
this may encapsulate the above routine, as we often need the component, e.g.
 o getTitle()
 o hierarchicalCluster(int)
Hierarchical clustering.
 o main(String[])
tests Multivariate routines
 o mouseUp(Event, int, int)
action when mouse is unclicked; if not overridden, no action
 o nonLinearMap(int, RealMatrix, int)
still being developed.
 o printAgglomeration()
print the agglomeration history of a cluster analysis on System.out.
 o printDendrogram()
print the dendrogram of a cluster analysis on System.out.
 o process()
most objects need some processing before they can be redrawn.
 o setDisplay(int)
sets display type:
 o stnlmp(int, int, int, int, double[][], double[][])
 o stnlmp1(int, int, int, double[][], double[][])

Variables

 o WARD
  public final static int WARD
different clustering methods
 o SLINK
  public final static int SLINK
 o CLINK
  public final static int CLINK
 o AVLINK
  public final static int AVLINK
 o MCQUITTY
  public final static int MCQUITTY
 o GOWER
  public final static int GOWER
 o CENTROID
  public final static int CENTROID
 o TABLE
  public final static int TABLE
display types

Constructors

 o Multivariate
  public Multivariate()
creates it with default data arrays
 o Multivariate
  public Multivariate(RealMatrix m)
creates a Multivariate data matrix (m columns, n rows of data)
 o Multivariate
  public Multivariate(RealSquareMatrix mat)
creates a asquare data matrix for distances

Methods

 o setDisplay
  public void setDisplay(int type)
sets display type:
 o hierarchicalCluster
  public void hierarchicalCluster(int method) throws ArrayTooSmallException
Hierarchical clustering. Algorithm and initial code taken (with many thanks) from the ASA Statlib resource (http:slash-slash-lib.stat.cmu.edu).

method is one of 7 switches (Multivariate.WARD, etc).

Throws: ArrayTooSmallException
data matrix has <= 2 rows and <= 1 dimensions.
 o printAgglomeration
  public void printAgglomeration()
print the agglomeration history of a cluster analysis on System.out. Very crude!
 o printDendrogram
  public void printDendrogram()
print the dendrogram of a cluster analysis on System.out. this is very crude at present !
 o nonLinearMap
  public int nonLinearMap(int ndim,
                          RealMatrix map,
                          int method) throws ArrayTooSmallException
still being developed. method = 0 is orginal, 1 is hacked neither seems to be any good ...
Throws: ArrayTooSmallException
nonLinearMap requires several points to avoid pathological behaviour
 o stnlmp1
  public static int stnlmp1(int mvar,
                            int ncase,
                            int ndim,
                            double zdata[][],
                            double xcoord[][])
 o stnlmp
  public static int stnlmp(int mvar,
                           int ncase,
                           int ndim,
                           int norm,
                           double zdata[][],
                           double xcoord[][])
 o display
  public void display(Graphics g)
used by the ScrollableTopLevel to paint the object, or can be used to draw the object to somewhere else.
Overrides:
display in class DrawableStat
 o display
  public void display(Graphics g,
                      Component comp)
this may encapsulate the above routine, as we often need the component, e.g.
Overrides:
display in class DrawableStat
 o getTitle
  public String getTitle()
Overrides:
getTitle in class Stat
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
action when mouse is unclicked; if not overridden, no action
Overrides:
mouseUp in class DrawableStat
 o process
  public void process()
most objects need some processing before they can be redrawn.
Overrides:
process in class Stat
 o main
  public static void main(String args[])
tests Multivariate routines

All Packages  Class Hierarchy  This Package  Previous  Next  Index