gov.sandia.cognition.statistics.bayesian
Class AdaptiveRejectionSampling.Point

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.data.AbstractInputOutputPair<InputType,OutputType>
          extended by gov.sandia.cognition.learning.data.DefaultInputOutputPair<Double,Double>
              extended by gov.sandia.cognition.statistics.bayesian.AdaptiveRejectionSampling.Point
All Implemented Interfaces:
InputOutputPair<Double,Double>, CloneableSerializable, Pair<Double,Double>, Serializable, Cloneable, Comparable<AdaptiveRejectionSampling.Point>
Enclosing class:
AdaptiveRejectionSampling

public static class AdaptiveRejectionSampling.Point
extends DefaultInputOutputPair<Double,Double>
implements Comparable<AdaptiveRejectionSampling.Point>

An InputOutputPair that has a natural ordering according to their input (x-axis) values.

See Also:
Serialized Form

Constructor Summary
AdaptiveRejectionSampling.Point(double x, double y)
          Creates a new instance of Point
 
Method Summary
 int compareTo(AdaptiveRejectionSampling.Point o)
           
static double intercept(PolynomialFunction.Linear line1, PolynomialFunction.Linear line2)
          Computes the x-axis value where the two lines intersect
static PolynomialFunction.Linear line(int index, ArrayList<AdaptiveRejectionSampling.Point> points)
          Connects the points at index and index + 1 with a straight line.
 
Methods inherited from class gov.sandia.cognition.learning.data.DefaultInputOutputPair
create, create, getInput, getOutput, labelCollection, mergeCollections, setInput, setOutput
 
Methods inherited from class gov.sandia.cognition.learning.data.AbstractInputOutputPair
getFirst, getSecond, toString
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdaptiveRejectionSampling.Point

public AdaptiveRejectionSampling.Point(double x,
                                       double y)
Creates a new instance of Point

Parameters:
x - Input (x-axis) value
y - Output (y-axis) value, most likely the natural logarithm of the function output.
Method Detail

compareTo

public int compareTo(AdaptiveRejectionSampling.Point o)
Specified by:
compareTo in interface Comparable<AdaptiveRejectionSampling.Point>

line

public static PolynomialFunction.Linear line(int index,
                                             ArrayList<AdaptiveRejectionSampling.Point> points)
Connects the points at index and index + 1 with a straight line. If index is 0, then we connect

Parameters:
index - Lower index to connect to index + 1
points - Points sorted along the x-axis
Returns:
Linear fit between the two given points.

intercept

public static double intercept(PolynomialFunction.Linear line1,
                               PolynomialFunction.Linear line2)
Computes the x-axis value where the two lines intersect

Parameters:
line1 - First line segment
line2 - Second line segment
Returns:
X-axis value where the two lines intersect