gov.sandia.cognition.statistics.method
Class ConfidenceInterval

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.method.ConfidenceInterval
All Implemented Interfaces:
CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
BayesianCredibleInterval, FieldConfidenceInterval

public class ConfidenceInterval
extends AbstractCloneableSerializable

Contains a specification for a confidence interval, that is, the solution of Pr{ lowerBound <= x(centralValue) <= upperBound } >= confidence

Since:
2.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
ConfidenceInterval(ConfidenceInterval other)
          Copy constructor
ConfidenceInterval(double centralValue, double lowerBound, double upperBound, double confidence, int numSamples)
          Creates a new instance of ConfidenceInterval
 
Method Summary
 double getCentralValue()
          Getter for centralValue
 double getConfidence()
          Getter for confidence
 double getLowerBound()
          Getter for lowerBound
 int getNumSamples()
          Getter for numSamples
 double getUpperBound()
          Getter for upperBound
protected  void setCentralValue(double centralValue)
          Setter for centralValue
protected  void setConfidence(double confidence)
          Setter for confidence
protected  void setLowerBound(double lowerBound)
          Setter for lowerBound
 void setNumSamples(int numSamples)
          Setter for numSamples
protected  void setUpperBound(double upperBound)
          Setter for upperBound
 String toString()
           
 boolean withinInterval(double value)
          Returns whether or not the value is within the specified interval
 
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

ConfidenceInterval

public ConfidenceInterval(double centralValue,
                          double lowerBound,
                          double upperBound,
                          double confidence,
                          int numSamples)
Creates a new instance of ConfidenceInterval

Parameters:
centralValue - Central value of the statistic (expectation, maximum likelihood, etc.)
lowerBound - Lower bound for the statistic
upperBound - Upper bound for the statistic
confidence - Confidence that the statistic is within the bound, or 1-alpha, on the interval [0,1], where confidence=0 means definitely not within the bound and confidence=1 means definite within the bound.
numSamples - The number of samples to take.

ConfidenceInterval

public ConfidenceInterval(ConfidenceInterval other)
Copy constructor

Parameters:
other - ConfidenceInterval to clone
Method Detail

getLowerBound

public double getLowerBound()
Getter for lowerBound

Returns:
Lower bound for the statistic

setLowerBound

protected void setLowerBound(double lowerBound)
Setter for lowerBound

Parameters:
lowerBound - Lower bound for the statistic

getUpperBound

public double getUpperBound()
Getter for upperBound

Returns:
Upper bound for the statistic

setUpperBound

protected void setUpperBound(double upperBound)
Setter for upperBound

Parameters:
upperBound - Upper bound for the statistic

getCentralValue

public double getCentralValue()
Getter for centralValue

Returns:
Central value of the statistic (expectation, maximum likelihood, etc.)

setCentralValue

protected void setCentralValue(double centralValue)
Setter for centralValue

Parameters:
centralValue - Central value of the statistic (expectation, maximum likelihood, etc.)

getConfidence

public double getConfidence()
Getter for confidence

Returns:
Confidence that the statistic is within the bound, or 1-alpha, on the interval [0,1], where confidence=0 means definitely not within the bound and confidence=1 means definite within the bound.

setConfidence

protected void setConfidence(double confidence)
Setter for confidence

Parameters:
confidence - Confidence that the statistic is within the bound, or 1-alpha, on the interval [0,1], where confidence=0 means definitely not within the bound and confidence=1 means definite within the bound.

toString

public String toString()
Overrides:
toString in class Object

getNumSamples

public int getNumSamples()
Getter for numSamples

Returns:
Number of sample values used to create the interval

setNumSamples

public void setNumSamples(int numSamples)
Setter for numSamples

Parameters:
numSamples - Number of sample values used to create the interval

withinInterval

public boolean withinInterval(double value)
Returns whether or not the value is within the specified interval

Parameters:
value - Value to determine if its within the interval
Returns:
True if within the interval, false otherwise