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

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.math.AbstractScalarFunction<Double>
          extended by gov.sandia.cognition.math.AbstractUnivariateScalarFunction
              extended by gov.sandia.cognition.math.AbstractDifferentiableUnivariateScalarFunction
                  extended by gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Linear
                      extended by gov.sandia.cognition.statistics.bayesian.AdaptiveRejectionSampling.LineSegment
All Implemented Interfaces:
Evaluator<Double,Double>, PolynomialFunction.ClosedForm, DifferentiableEvaluator<Double,Double,Double>, DifferentiableUnivariateScalarFunction, ScalarFunction<Double>, UnivariateScalarFunction, CloneableSerializable, Serializable, Cloneable, Comparable<Double>
Enclosing class:
AdaptiveRejectionSampling

public static class AdaptiveRejectionSampling.LineSegment
extends PolynomialFunction.Linear
implements Comparable<Double>

A line that has a minimum and maximum support (x-axis) value.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Linear
COLLINEAR_TOLERANCE
 
Constructor Summary
AdaptiveRejectionSampling.LineSegment(PolynomialFunction.Linear line, double left, double right)
          Creates a new instance of LineSegment
 
Method Summary
 int compareTo(Double o)
           
 double integrateExp()
          Integrates the exponent of the line segment
 double sampleExp(double p)
          Sample from the exponent of the line segment
 
Methods inherited from class gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Linear
clone, differentiate, evaluate, fit, fit, getQ0, getQ1, roots, setQ0, setQ1, stationaryPoints, toString
 
Methods inherited from class gov.sandia.cognition.math.AbstractDifferentiableUnivariateScalarFunction
differentiate
 
Methods inherited from class gov.sandia.cognition.math.AbstractUnivariateScalarFunction
evaluate, evaluateAsDouble
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.math.ScalarFunction
evaluateAsDouble
 
Methods inherited from interface gov.sandia.cognition.evaluator.Evaluator
evaluate
 
Methods inherited from interface gov.sandia.cognition.math.DifferentiableEvaluator
differentiate
 

Constructor Detail

AdaptiveRejectionSampling.LineSegment

public AdaptiveRejectionSampling.LineSegment(PolynomialFunction.Linear line,
                                             double left,
                                             double right)
Creates a new instance of LineSegment

Parameters:
line -
left - Left (minimum) x-axis value
right - Right (maximum) x-axis value
Method Detail

sampleExp

public double sampleExp(double p)
Sample from the exponent of the line segment

Parameters:
p - Probability into the line segment
Returns:
Sample (x-axis) value into the line segment

integrateExp

public double integrateExp()
Integrates the exponent of the line segment

Returns:
Integral of the exponent of the line segment

compareTo

public int compareTo(Double o)
Specified by:
compareTo in interface Comparable<Double>