JavaGrinders.spatial
Class AngleVariable

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by JavaGrinders.Variable
                  extended by JavaGrinders.NumberVariable
                      extended by JavaGrinders.spatial.AngleVariable
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class AngleVariable
extends NumberVariable
implements java.lang.Cloneable

handles things that a general variable containing angles should do or know about. Based on a more generic Variable it supports ways to select rows using a variety of criteria, and reports descriptive (parametric) statistics. All numbers are stored and handled as Doubles.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class JavaGrinders.NumberVariable
validDataSorted
 
Fields inherited from class JavaGrinders.Variable
allData, autoExtracted, df, itsDescriptives, itsHighlitedColor, itsLineColor, itsLocationColor, rand
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AngleVariable(java.lang.String varName, VariableOrganizer theOrganizer)
          Standard constructor for the root number Variable class using a VariableOrganizer
 
Method Summary
 void asCircularGraph()
          Creates a presenter and plots the movement vectors as a circular graph
 double betweenAngle(double AngleFrom, double AngleTo)
          find the angle that is halfway between the two angles in a clockwise direction
 java.lang.Object clone()
          clone the object
 CircularDescriptives copyCircularDescriptives()
          returns descriptive Circular Statistic for the variable using the currently selected set of rows
 int countNEq(double AngleFrom, double AngleTo)
          find the number of angles that are between or equal the two angles in a clockwise direction
 int countNLe(double AngleFrom, double AngleTo)
          find the number of angles that are between or equal the two angles in a clockwise direction
 void fillDescriptives(java.lang.Double hypMean)
          fills the descriptive circular statistics for the angle variable with a comparison to an external mean
 void fillDescriptives(java.lang.Double hypMean, boolean extraStats)
          fills the descriptive circular statistics for the angle variable with a comparison to an external mean
 AngleVariable fillInterestingAngles()
          fills a variable with angles that should be examined
 AngleVariable fillInterestingMedianAngles()
          fills a variable with angles that should be examined as median
 void fillMoreDescriptives()
          fills the descriptive circular statistics for the angle variable
 void fillWithParser(DataFileParser aParser, int varNum, boolean firstRowAsLabels)
          fills the variable with individual data values read from a textfile using a DataFileParser object
 void fillWithRandomFromDistribution(NumberVariable theDistribution)
          fills the variable with random values from a Gaussian Distribution
 void fillWithUniformRandom()
          fills the variable with random values from a uniform distribution between 0 and 360
 int[] getAngleFrequencies()
          creates and returns a variable containing the series of time distances between captures
 CircularDescriptives getCircularDescriptives()
          returns descriptive Circular Statistic for the variable using the currently selected set of rows
 Descriptives getDescriptives()
          returns the descriptives for the variable
 Descriptives getDescriptives(boolean extraStats)
          returns the descriptives for the variable
 double getDistance(double AngleFrom, double AngleTo)
          find the angle that is halfway between the two angles in a clockwise direction
 Descriptives[] getGroupDescriptives(Variable theXVar)
          lists the descriptives for the groups identified by X
 double getHodgesN()
          fills the descriptive circular statistics for the angle variable
 double getHodgesP(double HodgesN)
          returns the angle where the maximum number of angles are clustered within a range of 180 degrees
 double getMedian()
          fills the descriptive circular statistics for the angle variable
 double getRaoSpacing()
          returns Rao's Spacing Statistic for the variable using the currently selected set of rows.
 double getRayleighR()
          returns Rayleigh's R Statistic for the variable using the currently selected set of rows
 double getRayleighZ()
          returns Rayleigh's Z Statistic for the variable using the currently selected set of rows
 double getV(java.lang.Double hypothDegrees)
          returns V for the Modified Rayleigh Test for Uniformity vs.
 ANOVAResults getWatsonU2Results(Variable theXVar)
          returns the results from an analysis of differences in mean angles for a variable of locations
 ANOVAResults getWatsonWilliamsFResults(Variable theXVar)
          returns the results from an analysis of differences in mean angles for a variable of locations
 ANOVAResults getWheelerWResults(Variable theXVar)
          returns the results from an analysis of differences in mean angles for a variable of locations
 void listGroupDescriptiveItem()
          lists the descriptives for the groups identified by X
 void listGroupDescriptives(Variable theXVar)
          lists the descriptives for the groups identified by X
 void listGroupDescriptiveTitles()
          lists the descriptives for the groups identified by X
 void makeNewDescriptives()
          create a new set of descriptives for the variable the object
 double selectAngleRangeN(double AngleFrom, double AngleTo)
          select all rows with a value between the lower and upper limits provided.
 void selectRange(double AngleFrom, double AngleTo, boolean fromPrevSelected)
          select all rows with a value between the lower and upper limits provided when moving in a clockwise fashion.
 void selectRange(double AngleFrom, double AngleTo, boolean clockWise, boolean fromPrevSelected)
          select all rows with a value between the lower and upper limits provided.
 void setAnglesType()
          sets the variable to type ANGLES
 void setValue(int row, java.lang.Object anObject)
          sets a general object for a given row of the Vector
 void subtract(AngleVariable aAngleVar)
          sets a double value for a given row of the Vector
 
Methods inherited from class JavaGrinders.NumberVariable
absolute, copyNumberDescriptives, distance, doCorrelationAnalysis, doLinRegressionAnalysis, fillCompleteTerms, fillWithFormula, fillWithGaussRandom, fillWithRowNum, getANOVAResults, getANOVAResults, getAutoCorrelationResults, getCorrelationResults, getDistancesToMean, getLinRegressionResiduals, getLinRegressionResults, getManWhitneyUResults, getMaxValue, getMeanValue, getMinValue, getMultLinRegressionResults, getNumberDescriptives, getRange, getRanks, getSDValue, getSignedRank, getSignedRankW, getSignedRankWProbability, getSSCP, getSumValue, gettTestResults, gettValue, getVarianceValue, getzTransform, invalidDescriptives, listCorrelationResults, listLinRegressionResults, listMultLinRegressionResults, multiply, multiply, rank, selectAbove, selectAboveEqual, selectBelow, selectBelowEqual, selectEqual, setContinuousType, sign, subtract
 
Methods inherited from class JavaGrinders.Variable
addValue, append, appendVariable, asJAMAMatrix, asVariableOrganizer, checkMatchingRows, checkMinUseRows, checkNumberIDs, checkSameIDs, checkSameSelectRows, checkSameSelectRows, checkSameUseRows, checkSameUseRows, checkValidRowRange, cloneSelectedRowsOnly, cloneVariableFrom, combineSelectedWithSavedSelectedRows, copyDescriptives, copySelectStateFrom, customColorSelectedRows, deleteAllRows, deleteDuplicateRows, deleteMissingRows, deleteNonSelectedRows, deleteRow, deleteSelectedRows, deselectAllRows, fill, fill, fill, fill, fill, fill, fillDescriptives, fillIDs, fillWithParser, fillWithVariable, findFirstValidRow, findLastValidRow, findNextNonMissingRow, findNextValidRow, findNextValue, findPreviousValidRow, getabasedintValue, getAbasedintValue, getArray, getbooleanValue, getcharValue, getCombinedIDs, getCrossTabulation, getCrossTabulation, getCustomColorRow, getdoubleArray, getdoubleValue, getfloatValue, getFrequencies, getHighliteColor, getHighlitedRow, getIDMap, getIDs, getIDString, getIDStrings, getInteractions, getintValue, getJaccard, getLineColor, getLocationColor, getlongValue, getManhattan, getMissingRow, getName, getNIDs, getNMissingRows, getNotes, getNRows, getNSelectRows, getNUseRows, getNValidRows, getOrganizer, getProximity, getProximity, getRandomValue, getRowOrder, getRowOrderRow, getSelectRow, getSquEuclidian, getStringArray, getStringValue, getTransitions, getUseRow, getValue, getVariableDesignRole, getVariableDesignRoleString, getVariableFormat, getVariableType, highliteSelectedRows, highliteSelectedRows, invertSelectedRows, isAngleType, isContinuousType, isLocationType, isLocked, isNominalType, isOrdinalType, isXVariable, isYVariable, listDescriptives, listDescriptives, listGroupDescriptivesNoDia, listRowOrder, listRows, listRows, listRows, listSelectedRows, listSelectState, listSelectState, listUseRows, makeTableSubSet, matchedIDs, replaceSelectedRows, restoreSelectedRows, restrictToMatchingUseRows, restrictToMatchingUseRows, restrictToValidRowsOnly, reverseRows, saveSelectedRows, selectAllRows, selectDuplicateRows, selectRows, selectUseRows, selectValue, setCustomColorRow, setFormula, setHighliteColor, setHighlitedRow, setLineColor, setLocationColor, setLocationsType, setLock, setMissingRow, setName, setNominalType, setNotes, setNRows, setOrdinalType, setOrganizer, setRowOrder, setRowOrderRow, setSelectRow, setSelectRows, setSelectRowsToMissing, setValue, setValue, setValue, setValue, setValue, setVariableDesignRole, setVariableFormat, setVariableType, sort, sort, sort2, updateRowOrder
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

AngleVariable

public AngleVariable(java.lang.String varName,
                     VariableOrganizer theOrganizer)
              throws java.lang.Exception
Standard constructor for the root number Variable class using a VariableOrganizer

Parameters:
varName - assigns a name (String) to the variable
theOrganizer - an instance of VariableOrganizer class coordinates a set of variables with respect to number of data points available and the rows that are currently selected
Throws:
java.lang.Exception
Method Detail

clone

public java.lang.Object clone()
clone the object

Overrides:
clone in class Variable

setAnglesType

public void setAnglesType()
                   throws java.lang.Exception
sets the variable to type ANGLES

Overrides:
setAnglesType in class Variable
Throws:
java.lang.Exception

fillWithParser

public void fillWithParser(DataFileParser aParser,
                           int varNum,
                           boolean firstRowAsLabels)
                    throws java.lang.Exception
fills the variable with individual data values read from a textfile using a DataFileParser object

Overrides:
fillWithParser in class NumberVariable
Parameters:
aParser - the DataFileParser that was used to read data values from a text file
varNum - marks the number of the column to be filled into the variable
firstRowAsLabels - whether the first row contains a variable label
Throws:
java.lang.Exception

fillWithUniformRandom

public void fillWithUniformRandom()
                           throws java.lang.Exception
fills the variable with random values from a uniform distribution between 0 and 360

Overrides:
fillWithUniformRandom in class NumberVariable
Throws:
java.lang.Exception

fillWithRandomFromDistribution

public void fillWithRandomFromDistribution(NumberVariable theDistribution)
                                    throws java.lang.Exception
fills the variable with random values from a Gaussian Distribution

Overrides:
fillWithRandomFromDistribution in class NumberVariable
Parameters:
theDistribution - a distribution from which to sample random numbers
Throws:
java.lang.Exception

setValue

public void setValue(int row,
                     java.lang.Object anObject)
              throws java.lang.Exception
sets a general object for a given row of the Vector

Overrides:
setValue in class Variable
Parameters:
row - marks the row in the vector for which to set the value
anObject - lists the Object to set for the row
Throws:
java.lang.Exception

selectRange

public void selectRange(double AngleFrom,
                        double AngleTo,
                        boolean fromPrevSelected)
                 throws java.lang.Exception
select all rows with a value between the lower and upper limits provided when moving in a clockwise fashion. This includes values equal to the lower limit and excludes the upper limit

Overrides:
selectRange in class NumberVariable
Parameters:
AngleFrom - the one limit
AngleTo - the other limit
fromPrevSelected - notes whether the search should only be performed on currently selected rows
Throws:
java.lang.Exception

selectRange

public void selectRange(double AngleFrom,
                        double AngleTo,
                        boolean clockWise,
                        boolean fromPrevSelected)
                 throws java.lang.Exception
select all rows with a value between the lower and upper limits provided. This includes values equal to the lower limit and excludes the upper limit

Parameters:
AngleFrom - the one limit
AngleTo - the other limit
clockWise - notes whether the search should be performed on in a clockwise fashion
fromPrevSelected - notes whether the search should only be performed on currently selected rows
Throws:
java.lang.Exception

selectAngleRangeN

public double selectAngleRangeN(double AngleFrom,
                                double AngleTo)
                         throws java.lang.Exception
select all rows with a value between the lower and upper limits provided. This includes values equal to the lower limit and excludes the upper limit

Parameters:
AngleFrom - the one limit
AngleTo - the other limit
Throws:
java.lang.Exception

listGroupDescriptives

public void listGroupDescriptives(Variable theXVar)
                           throws java.lang.Exception
lists the descriptives for the groups identified by X

Overrides:
listGroupDescriptives in class NumberVariable
Parameters:
theXVar - variable that contains information on group assignment
Throws:
java.lang.Exception

listGroupDescriptiveTitles

public void listGroupDescriptiveTitles()
lists the descriptives for the groups identified by X


listGroupDescriptiveItem

public void listGroupDescriptiveItem()
                              throws java.lang.Exception
lists the descriptives for the groups identified by X

Throws:
java.lang.Exception

makeNewDescriptives

public void makeNewDescriptives()
create a new set of descriptives for the variable the object

Overrides:
makeNewDescriptives in class NumberVariable

fillDescriptives

public void fillDescriptives(java.lang.Double hypMean)
                      throws java.lang.Exception
fills the descriptive circular statistics for the angle variable with a comparison to an external mean

Overrides:
fillDescriptives in class NumberVariable
Parameters:
hypMean - the value of the a-priori hypothesis mean
Throws:
java.lang.Exception

fillDescriptives

public void fillDescriptives(java.lang.Double hypMean,
                             boolean extraStats)
                      throws java.lang.Exception
fills the descriptive circular statistics for the angle variable with a comparison to an external mean

Parameters:
hypMean - the value of the a-priori hypothesis mean
extraStats - calculate additional circular statistics
Throws:
java.lang.Exception

fillMoreDescriptives

public void fillMoreDescriptives()
                          throws java.lang.Exception
fills the descriptive circular statistics for the angle variable

Throws:
java.lang.Exception

getCircularDescriptives

public CircularDescriptives getCircularDescriptives()
                                             throws java.lang.Exception
returns descriptive Circular Statistic for the variable using the currently selected set of rows

Throws:
java.lang.Exception

copyCircularDescriptives

public CircularDescriptives copyCircularDescriptives()
                                              throws java.lang.Exception
returns descriptive Circular Statistic for the variable using the currently selected set of rows

Throws:
java.lang.Exception

getGroupDescriptives

public Descriptives[] getGroupDescriptives(Variable theXVar)
                                    throws java.lang.Exception
lists the descriptives for the groups identified by X

Overrides:
getGroupDescriptives in class NumberVariable
Parameters:
theXVar - variable that contains information on group assignment
Throws:
java.lang.Exception

getDescriptives

public Descriptives getDescriptives()
                             throws java.lang.Exception
returns the descriptives for the variable

Overrides:
getDescriptives in class Variable
Throws:
java.lang.Exception

getDescriptives

public Descriptives getDescriptives(boolean extraStats)
                             throws java.lang.Exception
returns the descriptives for the variable

Parameters:
extraStats - calculate additional circular statistics
Throws:
java.lang.Exception

countNEq

public int countNEq(double AngleFrom,
                    double AngleTo)
             throws java.lang.Exception
find the number of angles that are between or equal the two angles in a clockwise direction

Parameters:
AngleFrom - the one limit
AngleTo - the other limit
Throws:
java.lang.Exception

countNLe

public int countNLe(double AngleFrom,
                    double AngleTo)
             throws java.lang.Exception
find the number of angles that are between or equal the two angles in a clockwise direction

Parameters:
AngleFrom - the one limit
AngleTo - the other limit
Throws:
java.lang.Exception

subtract

public void subtract(AngleVariable aAngleVar)
              throws java.lang.Exception
sets a double value for a given row of the Vector

Parameters:
aAngleVar - the angles to subtract
Throws:
java.lang.Exception

getDistance

public double getDistance(double AngleFrom,
                          double AngleTo)
                   throws java.lang.Exception
find the angle that is halfway between the two angles in a clockwise direction

Parameters:
AngleFrom - the one limit
AngleTo - the other limit
Throws:
java.lang.Exception

betweenAngle

public double betweenAngle(double AngleFrom,
                           double AngleTo)
                    throws java.lang.Exception
find the angle that is halfway between the two angles in a clockwise direction

Parameters:
AngleFrom - the one limit
AngleTo - the other limit
Throws:
java.lang.Exception

getAngleFrequencies

public int[] getAngleFrequencies()
                          throws java.lang.Exception
creates and returns a variable containing the series of time distances between captures

Throws:
java.lang.Exception

getRayleighR

public double getRayleighR()
                    throws java.lang.Exception
returns Rayleigh's R Statistic for the variable using the currently selected set of rows

Throws:
java.lang.Exception

getRayleighZ

public double getRayleighZ()
                    throws java.lang.Exception
returns Rayleigh's Z Statistic for the variable using the currently selected set of rows

Throws:
java.lang.Exception

getRaoSpacing

public double getRaoSpacing()
                     throws java.lang.Exception
returns Rao's Spacing Statistic for the variable using the currently selected set of rows. Angles have to be in degrees not radians

Throws:
java.lang.Exception

getV

public double getV(java.lang.Double hypothDegrees)
            throws java.lang.Exception
returns V for the Modified Rayleigh Test for Uniformity vs. a specified Angle

Parameters:
hypothDegrees - the degrees under the hypothesis
Throws:
java.lang.Exception

getWatsonWilliamsFResults

public ANOVAResults getWatsonWilliamsFResults(Variable theXVar)
                                       throws java.lang.Exception
returns the results from an analysis of differences in mean angles for a variable of locations

Parameters:
theXVar - variable that contains information on group assignment
Throws:
java.lang.Exception

getWatsonU2Results

public ANOVAResults getWatsonU2Results(Variable theXVar)
                                throws java.lang.Exception
returns the results from an analysis of differences in mean angles for a variable of locations

Parameters:
theXVar - variable that contains information on group assignment
Throws:
java.lang.Exception

getWheelerWResults

public ANOVAResults getWheelerWResults(Variable theXVar)
                                throws java.lang.Exception
returns the results from an analysis of differences in mean angles for a variable of locations

Parameters:
theXVar - variable that contains information on group assignment
Throws:
java.lang.Exception

fillInterestingAngles

public AngleVariable fillInterestingAngles()
                                    throws java.lang.Exception
fills a variable with angles that should be examined

Throws:
java.lang.Exception

fillInterestingMedianAngles

public AngleVariable fillInterestingMedianAngles()
                                          throws java.lang.Exception
fills a variable with angles that should be examined as median

Throws:
java.lang.Exception

getHodgesP

public double getHodgesP(double HodgesN)
                  throws java.lang.Exception
returns the angle where the maximum number of angles are clustered within a range of 180 degrees

Parameters:
HodgesN - the number of angles
Throws:
java.lang.Exception

getHodgesN

public double getHodgesN()
                  throws java.lang.Exception
fills the descriptive circular statistics for the angle variable

Throws:
java.lang.Exception

getMedian

public double getMedian()
                 throws java.lang.Exception
fills the descriptive circular statistics for the angle variable

Throws:
java.lang.Exception

asCircularGraph

public void asCircularGraph()
Creates a presenter and plots the movement vectors as a circular graph