uk.ac.leeds.ccg.andyt.grids.utilities
Class Kernel

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.utilities.Kernel

public abstract class Kernel
extends java.lang.Object

Class of methods to do with kernels.


Constructor Summary
Kernel()
           
 
Method Summary
static double getAdaptiveKernelWeight(double distance, double bandwidth, double sumWeights, int precision, double weightIntersect, double weightFactor)
          Returns a double representing an adaptive kernel weight.
static double[] getKernelParameters(AbstractGrid2DSquareCell grid2DSquareCell, int cellDistance, double distance, double weightIntersect, double weightFactor)
          Returns double[] result of kernel parameters where: result[0] = The total sum of all the weights for a given kernel; result[1] = The total number of cells thats centroids are within distance of an arbitrary cell centroid of grid2DSquareCell.
static double getKernelVolume(double bandwidth, int precision, double weightIntersect, double weightFactor)
          Returns a double representing the kernel volume.
static double getKernelWeight(double distance, double weightIntersect, double weightFactor, double thisDistance)
          Returns a double value for the height of a kernel at thisDistance from the centre of a kernel with; Bandwidth distance, weight at the centre of weightIntersect and distance decay of weightFactor.
static double[][] getKernelWeights(AbstractGrid2DSquareCell grid2DSquareCell, double distance, double weightIntersect, double weightFactor)
          Returns a double[] of kernel weights.
static double[] getKernelWeights(AbstractGrid2DSquareCell grid2DSquareCell, long rowIndex, long colIndex, double distance, double weightIntersect, double weightFactor, java.awt.geom.Point2D.Double[] points)
          Returns a double[] of kernel weights.
static double[] getKernelWeights(java.awt.geom.Point2D.Double centroid, double distance, double weightIntersect, double weightFactor, java.awt.geom.Point2D.Double[] points)
          Returns double[] result of kernel weights.
static double getNormalDistributionKernelWeight(double _Value, double _Mean, double _Variance)
           
static double[][] getNormalDistributionKernelWeights(AbstractGrid2DSquareCell _Grid2DSquareCell, double _Distance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kernel

public Kernel()
Method Detail

getNormalDistributionKernelWeight

public static double getNormalDistributionKernelWeight(double _Value,
                                                       double _Mean,
                                                       double _Variance)
Parameters:
_Value -
_Mean -
_Variance -
Returns:
double expected value of a normal distribution with mean _Mean and variance _Variance for _Value

getNormalDistributionKernelWeights

public static double[][] getNormalDistributionKernelWeights(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                            double _Distance)
Parameters:
_Grid2DSquareCell -
_Distance -
Returns:
double[] of kernel weights based on the normal distribution. The mean and variance of the normal distribution is given by the distances to the centroids of the cells in _Grid2DSquareCell within distance for any cell centroid.

getKernelWeight

public static double getKernelWeight(double distance,
                                     double weightIntersect,
                                     double weightFactor,
                                     double thisDistance)
Returns a double value for the height of a kernel at thisDistance from the centre of a kernel with; Bandwidth distance, weight at the centre of weightIntersect and distance decay of weightFactor.

Parameters:
distance -
weightIntersect -
weightFactor - Warning: If weightfactor is < 1.0d strange things could be happening!!!!

getKernelWeights

public static double[][] getKernelWeights(AbstractGrid2DSquareCell grid2DSquareCell,
                                          double distance,
                                          double weightIntersect,
                                          double weightFactor)
Returns a double[] of kernel weights.

Parameters:
grid2DSquareCell -
distance -
weightIntersect -
weightFactor -

getKernelWeights

public static double[] getKernelWeights(AbstractGrid2DSquareCell grid2DSquareCell,
                                        long rowIndex,
                                        long colIndex,
                                        double distance,
                                        double weightIntersect,
                                        double weightFactor,
                                        java.awt.geom.Point2D.Double[] points)
Returns a double[] of kernel weights.

Parameters:
grid2DSquareCell -
rowIndex -
colIndex -
distance -
weightIntersect -
weightFactor -
points -

getKernelWeights

public static double[] getKernelWeights(java.awt.geom.Point2D.Double centroid,
                                        double distance,
                                        double weightIntersect,
                                        double weightFactor,
                                        java.awt.geom.Point2D.Double[] points)
Returns double[] result of kernel weights.

Parameters:
centroid -
distance -
weightIntersect -
weightFactor -
points -

getKernelParameters

public static double[] getKernelParameters(AbstractGrid2DSquareCell grid2DSquareCell,
                                           int cellDistance,
                                           double distance,
                                           double weightIntersect,
                                           double weightFactor)
Returns double[] result of kernel parameters where: result[0] = The total sum of all the weights for a given kernel; result[1] = The total number of cells thats centroids are within distance of an arbitrary cell centroid of grid2DSquareCell.

Parameters:
grid2DSquareCell - AbstractGrid2DSquareCell for which kernel parameters are returned
cellDistance -
distance -
weightIntersect -
weightFactor -

getAdaptiveKernelWeight

public static double getAdaptiveKernelWeight(double distance,
                                             double bandwidth,
                                             double sumWeights,
                                             int precision,
                                             double weightIntersect,
                                             double weightFactor)
Returns a double representing an adaptive kernel weight.

Parameters:
distance -
bandwidth -
sumWeights -
precision -
weightIntersect -
weightFactor -

getKernelVolume

public static double getKernelVolume(double bandwidth,
                                     int precision,
                                     double weightIntersect,
                                     double weightFactor)
Returns a double representing the kernel volume.

Parameters:
bandwidth -
precision -
weightIntersect -
weightFactor -