Class PSquarePercentile.Marker
- java.lang.Object
-
- org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.Marker
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Enclosing class:
- PSquarePercentile
private static class PSquarePercentile.Marker extends java.lang.Object implements java.io.Serializable, java.lang.CloneableThe class modeling the attributes of the marker of the P-square algorithm
-
-
Field Summary
Fields Modifier and Type Field Description private doubledesiredMarkerIncrementDesired marker increment.private doubledesiredMarkerPositionDesired marker position.private intindexThe marker index which is just a serial number for the marker in the marker array of 5+1.private doubleintMarkerPositionThe integral marker position.private UnivariateInterpolatorlinearLinear interpolator which is not serializableprivate doublemarkerHeightMarker height or the quantile.private PSquarePercentile.MarkernextNext and previous markers for easy linked navigation in loops.private UnivariateInterpolatornonLinearNonlinear interpolatorprivate PSquarePercentile.MarkerpreviousThe previous marker linksprivate static longserialVersionUIDSerial Version ID
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clone this instance.private doubledifference()Difference between desired and actual positionbooleanequals(java.lang.Object o)This equals method checks for marker attributes and as well checks if navigation pointers (next and previous) are the same between this and passed in objectprivate doubleestimate()Estimate the quantile for the current marker.inthashCode()private voidincrementPosition(int d)Increment Position by d.private PSquarePercentile.Markerindex(int indexOfMarker)Sets the index of the marker.private booleanisEstimateBad(double[] y, double yD)Check if parabolic/nonlinear estimate is bad by checking if the ordinate found is beyond the y[0] and y[2].private PSquarePercentile.Markernext(PSquarePercentile.Marker nextMarker)Sets the next marker.private PSquarePercentile.Markerprevious(PSquarePercentile.Marker previousMarker)Sets the previous marker.private voidreadObject(java.io.ObjectInputStream anInstream)Read Object to deserialize.java.lang.StringtoString()private voidupdateDesiredPosition()Update desired Position with increment.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serial Version ID- See Also:
- Constant Field Values
-
index
private int index
The marker index which is just a serial number for the marker in the marker array of 5+1.
-
intMarkerPosition
private double intMarkerPosition
The integral marker position. Refer to the variable n in the original works.
-
desiredMarkerPosition
private double desiredMarkerPosition
Desired marker position. Refer to the variable n' in the original works.
-
markerHeight
private double markerHeight
Marker height or the quantile. Refer to the variable q in the original works.
-
desiredMarkerIncrement
private double desiredMarkerIncrement
Desired marker increment. Refer to the variable dn' in the original works.
-
next
private transient PSquarePercentile.Marker next
Next and previous markers for easy linked navigation in loops. this is not serialized as they can be rebuilt during deserialization.
-
previous
private transient PSquarePercentile.Marker previous
The previous marker links
-
nonLinear
private final UnivariateInterpolator nonLinear
Nonlinear interpolator
-
linear
private transient UnivariateInterpolator linear
Linear interpolator which is not serializable
-
-
Constructor Detail
-
Marker
private Marker()
Default constructor
-
Marker
private Marker(double heightOfMarker, double makerPositionDesired, double markerPositionIncrement, double markerPositionNumber)Constructor of the marker with parameters- Parameters:
heightOfMarker- represent the quantile valuemakerPositionDesired- represent the desired marker positionmarkerPositionIncrement- represent increments for positionmarkerPositionNumber- represent the position number of marker
-
-
Method Detail
-
previous
private PSquarePercentile.Marker previous(PSquarePercentile.Marker previousMarker)
Sets the previous marker.- Parameters:
previousMarker- the previous marker to the current marker in the array of markers- Returns:
- this instance
-
next
private PSquarePercentile.Marker next(PSquarePercentile.Marker nextMarker)
Sets the next marker.- Parameters:
nextMarker- the next marker to the current marker in the array of markers- Returns:
- this instance
-
index
private PSquarePercentile.Marker index(int indexOfMarker)
Sets the index of the marker.- Parameters:
indexOfMarker- the array index of the marker in marker array- Returns:
- this instance
-
updateDesiredPosition
private void updateDesiredPosition()
Update desired Position with increment.
-
incrementPosition
private void incrementPosition(int d)
Increment Position by d.- Parameters:
d- a delta value to increment
-
difference
private double difference()
Difference between desired and actual position- Returns:
- difference between desired and actual position
-
estimate
private double estimate()
Estimate the quantile for the current marker.- Returns:
- estimated quantile
-
isEstimateBad
private boolean isEstimateBad(double[] y, double yD)Check if parabolic/nonlinear estimate is bad by checking if the ordinate found is beyond the y[0] and y[2].- Parameters:
y- the array to get the boundsyD- the estimate- Returns:
- true if yD is a bad estimate
-
equals
public boolean equals(java.lang.Object o)
This equals method checks for marker attributes and as well checks if navigation pointers (next and previous) are the same between this and passed in object- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Other object- Returns:
- true if this equals passed in other object o
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
readObject
private void readObject(java.io.ObjectInputStream anInstream) throws java.lang.ClassNotFoundException, java.io.IOExceptionRead Object to deserialize.- Parameters:
anInstream- Stream Object data- Throws:
java.io.IOException- thrown for IO Errorsjava.lang.ClassNotFoundException- thrown for class not being found
-
clone
public java.lang.Object clone()
Clone this instance.- Overrides:
clonein classjava.lang.Object- Returns:
- cloned marker
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-