|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.layer.StandardKernel1dShape
@Equality public abstract class StandardKernel1dShape
Implementation class for Kernel1dShapes based on evaluating symmetric functions over a limited extent.
Field Summary | |
---|---|
static StandardKernel1dShape |
COS
Cosine kernel shape. |
static StandardKernel1dShape |
COS2
Cosine squared kernel shape. |
static Kernel1d |
DELTA
Delta function kernel. |
static StandardKernel1dShape |
EPANECHNIKOV
Epanechnikov (parabola) kernel shape. |
static StandardKernel1dShape |
LINEAR
Linear (triangular) kernel shape. |
static StandardKernel1dShape |
SQUARE
Rectangular kernel shape. |
Constructor Summary | |
---|---|
protected |
StandardKernel1dShape(String name,
String description,
double normExtent,
boolean isSquare)
Constructor. |
Method Summary | |
---|---|
Kernel1d |
createFixedWidthKernel(double width)
Creates a fixed width kernel with a given nominal width. |
Kernel1d |
createKnnKernel(double k,
boolean isSymmetric,
int minWidth,
int maxWidth)
Creates an adaptive kernel that uses a K-nearest-neighbours algorithm to determine local smoothing width, so that the width of the kernel is determined by the distance (number of 1-pixel bins) within which the given number k of samples is found. |
static Kernel1d |
createSymmetricNormalisedKernel(double[] levels,
boolean isSquare)
Creates a symmetric normalised kernel based on a fixed array of function values. |
static StandardKernel1dShape |
createTruncatedGaussian(double truncSigma)
Returns a kernel shape based on the Gaussian function with truncation at a given number of standard deviations. |
protected abstract double |
evaluate(double x)
Returns the point value of the function defining this shape at a point a given absolute fraction of the nominal width from the center. |
String |
getDescription()
Returns a short description for this shape. |
String |
getName()
Returns a one-word name for this shape. |
double |
getNormalisedExtent()
Returns the extent of a kernel with this shape of unit nominal width. |
static Kernel1dShape[] |
getStandardOptions()
Returns an array of the generally recommended kernel shape options. |
boolean |
isSquare()
Indicates whether this shape has features which are intentionally non-smooth and should be portrayed as such. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final StandardKernel1dShape SQUARE
public static final StandardKernel1dShape LINEAR
public static final StandardKernel1dShape EPANECHNIKOV
public static final StandardKernel1dShape COS
public static final StandardKernel1dShape COS2
public static final Kernel1d DELTA
Constructor Detail |
---|
protected StandardKernel1dShape(String name, String description, double normExtent, boolean isSquare)
name
- kernel shape namedescription
- short descriptionnormExtent
- kernel extent for unit nominal widthisSquare
- true iff kernel is considered non-smoothMethod Detail |
---|
protected abstract double evaluate(double x)
x
out of the range
0<=x<=getNormalisedExtent()
has an undefined
effect; the function value is assumed symmetric and zero for
larger absolute values.
x
- normalised absolute distance in range 0..normExtent
x
public double getNormalisedExtent()
evaluate(x)
method for
x
greater than the value returned from this method
is taken to be zero.
public boolean isSquare()
public String getName()
getName
in interface Kernel1dShape
public String getDescription()
getDescription
in interface Kernel1dShape
public Kernel1d createFixedWidthKernel(double width)
Kernel1dShape
createFixedWidthKernel
in interface Kernel1dShape
width
- half-width
public Kernel1d createKnnKernel(double k, boolean isSymmetric, int minWidth, int maxWidth)
Kernel1dShape
k
of samples is found.
The nearest neighbour search may be symmetric or asymmetric. In the asymmetric case, the kernel width is determined separately for the positive and negative directions along the axis.
Minimum and maximum smoothing widths are also supplied as bounds
on the smoothing width for the case that the samples are very
dense or very spread out (the latter case covers the edge of the
data region as well).
If minWidth==maxWidth
, the result is a fixed-width kernel.
createKnnKernel
in interface Kernel1dShape
k
- number of nearest neighbours included in the distance
that characterises the smoothingisSymmetric
- true for bidirectional KNN search,
false for unidirectionalminWidth
- minimum smoothing widthmaxWidth
- maximum smoothing width
public String toString()
toString
in class Object
public static Kernel1dShape[] getStandardOptions()
public static StandardKernel1dShape createTruncatedGaussian(double truncSigma)
truncSigma
- number of sigma at which to truncate the kernel
public static Kernel1d createSymmetricNormalisedKernel(double[] levels, boolean isSquare)
levels
array gives a list of
the values at x=0, 1 (and -1), 2 (and -2), ....
levels
- kernel function values on 1d grid starting from 0isSquare
- true iff the kernel is considered non-smooth
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |