private static class PSquarePercentile.Markers extends java.lang.Object implements PSquarePercentile.PSquareMarkers, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private static int |
HIGH
High marker index
|
private int |
k
Kth cell belonging to [1-5] of the markerArray.
|
private static int |
LOW
Low marker index
|
private PSquarePercentile.Marker[] |
markerArray
Array of 5+1 Markers (The first marker is dummy just so we
can match the rest of indexes [1-5] indicated in the original works
which follows unit based index)
|
private static long |
serialVersionUID
Serial version id
|
| Modifier | Constructor and Description |
|---|---|
private |
PSquarePercentile.Markers(java.util.List<java.lang.Double> initialFive,
double p)
Constructor
|
private |
PSquarePercentile.Markers(PSquarePercentile.Marker[] theMarkerArray)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
private void |
adjustHeightsOfMarkers()
Adjust marker heights by setting quantile estimates to middle markers.
|
java.lang.Object |
clone()
A clone function to clone the current instance.
|
private static PSquarePercentile.Marker[] |
createMarkerArray(java.util.List<java.lang.Double> initialFive,
double p)
Creates a marker array using initial five elements and a quantile
|
boolean |
equals(java.lang.Object o)
.This equals method basically checks for marker array to
be deep equals.
|
double |
estimate(int index)
An Estimate of the percentile value of a given Marker
|
private int |
findCellAndUpdateMinMax(double observation)
Finds the cell where the input observation / value fits.
|
double |
getPercentileValue()
Returns the percentile computed thus far.
|
int |
hashCode() |
double |
height(int markerIndex)
Return marker height given index
|
private void |
incrementPositions(int d,
int startIndex,
int endIndex)
Increment positions by d.
|
double |
processDataPoint(double inputDataPoint)
Process a data point
|
private void |
readObject(java.io.ObjectInputStream anInputStream)
Sets previous and next markers after default read is done.
|
java.lang.String |
toString()
Returns string representation of the Marker array.
|
private void |
updateDesiredPositions()
Desired positions incremented by bucket width.
|
private static final long serialVersionUID
private static final int LOW
private static final int HIGH
private final PSquarePercentile.Marker[] markerArray
private transient int k
private PSquarePercentile.Markers(PSquarePercentile.Marker[] theMarkerArray)
theMarkerArray - marker array to be usedprivate PSquarePercentile.Markers(java.util.List<java.lang.Double> initialFive,
double p)
initialFive - elements required to build Markerp - quantile required to be computedprivate static PSquarePercentile.Marker[] createMarkerArray(java.util.List<java.lang.Double> initialFive, double p)
initialFive - list of initial five elementsp - the pth quantilepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - is the other objectpublic double processDataPoint(double inputDataPoint)
processDataPoint in interface PSquarePercentile.PSquareMarkersinputDataPoint - is the data point passedpublic double getPercentileValue()
getPercentileValue in interface PSquarePercentile.PSquareMarkersprivate int findCellAndUpdateMinMax(double observation)
observation - the input value to be checked forprivate void adjustHeightsOfMarkers()
public double estimate(int index)
estimate in interface PSquarePercentile.PSquareMarkersindex - the marker's index in the array of markersprivate void incrementPositions(int d,
int startIndex,
int endIndex)
d - The increment value for the positionstartIndex - start index of the marker arrayendIndex - end index of the marker arrayprivate void updateDesiredPositions()
private void readObject(java.io.ObjectInputStream anInputStream)
throws java.lang.ClassNotFoundException,
java.io.IOException
anInputStream - the input stream to be deserializedjava.lang.ClassNotFoundException - thrown when a desired class not foundjava.io.IOException - thrown due to any io errorspublic double height(int markerIndex)
height in interface PSquarePercentile.PSquareMarkersmarkerIndex - index of marker within (1,6)public java.lang.Object clone()
clone in interface PSquarePercentile.PSquareMarkersclone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) 2003-2015 Apache Software Foundation