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.Cloneable
The class modeling the attributes of the marker of the P-square algorithm
-
-
Field Summary
Fields Modifier and Type Field Description private double
desiredMarkerIncrement
Desired marker increment.private double
desiredMarkerPosition
Desired marker position.private int
index
The marker index which is just a serial number for the marker in the marker array of 5+1.private double
intMarkerPosition
The integral marker position.private UnivariateInterpolator
linear
Linear interpolator which is not serializableprivate double
markerHeight
Marker height or the quantile.private PSquarePercentile.Marker
next
Next and previous markers for easy linked navigation in loops.private UnivariateInterpolator
nonLinear
Nonlinear interpolatorprivate PSquarePercentile.Marker
previous
The previous marker linksprivate static long
serialVersionUID
Serial Version ID
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Clone this instance.private double
difference()
Difference between desired and actual positionboolean
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 objectprivate double
estimate()
Estimate the quantile for the current marker.int
hashCode()
private void
incrementPosition(int d)
Increment Position by d.private PSquarePercentile.Marker
index(int indexOfMarker)
Sets the index of the marker.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].private PSquarePercentile.Marker
next(PSquarePercentile.Marker nextMarker)
Sets the next marker.private PSquarePercentile.Marker
previous(PSquarePercentile.Marker previousMarker)
Sets the previous marker.private void
readObject(java.io.ObjectInputStream anInstream)
Read Object to deserialize.java.lang.String
toString()
private void
updateDesiredPosition()
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:
equals
in classjava.lang.Object
- Parameters:
o
- Other object- Returns:
- true if this equals passed in other object o
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
readObject
private void readObject(java.io.ObjectInputStream anInstream) throws java.lang.ClassNotFoundException, java.io.IOException
Read 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:
clone
in classjava.lang.Object
- Returns:
- cloned marker
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-