org.opensha.commons.data.estimate
Class Estimate

java.lang.Object
  extended by org.opensha.commons.data.estimate.Estimate
Direct Known Subclasses:
DiscretizedFuncEstimate, FractileListEstimate, LogNormalEstimate, MinMaxPrefEstimate, NormalEstimate

public abstract class Estimate
extends Object

Title: Estimate.java

Description: This is the abstract class for various types of estimates. Most methods here throw unsupported exceptions because this will often be the case in subclasses.

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:

Field Summary
protected  String comments
           
protected static String EST_MSG_FIRST_LAST_PROB_ZERO
           
protected static String EST_MSG_INVLID_RANGE
           
protected static String EST_MSG_MAX_LT_MIN
           
protected static String EST_MSG_NOT_NORMALIZED
           
protected static String EST_MSG_PROB_POSITIVE
           
protected static String EST_MSG_PROBS_NOT_INCREASING
           
protected static String FRACTILE_UNDEFINED
           
protected  double max
           
protected static String MEDIAN_UNDEFINED
           
protected  double min
           
protected static String MSG_ALL_PROB_ZERO
           
protected static String MSG_INVALID_STDDEV
           
protected  String units
           
 
Constructor Summary
Estimate()
           
 
Method Summary
 AbstractDiscretizedFunc getCDF_Test()
          Test function to get the CDF for this estimate.
 AbstractDiscretizedFunc getCDF_TestUsingFractile()
          Test function to get the CDF for this estimate.
 String getComments()
          Get the comments associated with this object
 double getFractile(double prob)
          Get fractile for a given probability (the value where the CDF equals prob).
 double getMax()
          Get the maximum value (on X axis)
 double getMean()
          Get the mean for this estimate
 double getMedian()
          Get median for this estimate
 double getMin()
          Get the minimum value (on X axis)
 double getMode()
          Get mode for this estimate
abstract  String getName()
          Get the name.
 AbstractDiscretizedFunc getPDF_Test()
          Test function to find the PDF for this estimate.
 double getProbLessThanEqual(double x)
          Get the probability that the true value is less than or equal to the provided x value (the CDF for a probability density funtion)
 double getStdDev()
          Get Std Dev for this estimate
 String getUnits()
          Get units for this estimate
 boolean isNegativeValuePresent()
          Checks whether there exist any X values which are less than 0.
 void setComments(String comments)
          Set the comments in this object
 void setUnits(String units)
          Set the units in this estimate
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EST_MSG_MAX_LT_MIN

protected static final String EST_MSG_MAX_LT_MIN
See Also:
Constant Field Values

EST_MSG_NOT_NORMALIZED

protected static final String EST_MSG_NOT_NORMALIZED
See Also:
Constant Field Values

EST_MSG_PROB_POSITIVE

protected static final String EST_MSG_PROB_POSITIVE
See Also:
Constant Field Values

EST_MSG_INVLID_RANGE

protected static final String EST_MSG_INVLID_RANGE
See Also:
Constant Field Values

EST_MSG_FIRST_LAST_PROB_ZERO

protected static final String EST_MSG_FIRST_LAST_PROB_ZERO
See Also:
Constant Field Values

MSG_INVALID_STDDEV

protected static final String MSG_INVALID_STDDEV
See Also:
Constant Field Values

MSG_ALL_PROB_ZERO

protected static final String MSG_ALL_PROB_ZERO
See Also:
Constant Field Values

EST_MSG_PROBS_NOT_INCREASING

protected static final String EST_MSG_PROBS_NOT_INCREASING
See Also:
Constant Field Values

MEDIAN_UNDEFINED

protected static final String MEDIAN_UNDEFINED
See Also:
Constant Field Values

FRACTILE_UNDEFINED

protected static final String FRACTILE_UNDEFINED
See Also:
Constant Field Values

comments

protected String comments

min

protected double min

max

protected double max

units

protected String units
Constructor Detail

Estimate

public Estimate()
Method Detail

getUnits

public String getUnits()
Get units for this estimate

Returns:

setUnits

public void setUnits(String units)
Set the units in this estimate

Parameters:
units -

getMean

public double getMean()
Get the mean for this estimate

Returns:

getMedian

public double getMedian()
Get median for this estimate

Returns:

getStdDev

public double getStdDev()
Get Std Dev for this estimate

Returns:

getFractile

public double getFractile(double prob)
Get fractile for a given probability (the value where the CDF equals prob).

Parameters:
prob -
Returns:

getMode

public double getMode()
Get mode for this estimate

Returns:

isNegativeValuePresent

public boolean isNegativeValuePresent()
Checks whether there exist any X values which are less than 0.

Returns:
It returns true if any x<0. If all x>=0, it returns false

getMax

public double getMax()
Get the maximum value (on X axis)

Returns:
maximum value (on X axis)

getMin

public double getMin()
Get the minimum value (on X axis)

Returns:
minimum value (on X axis)

getComments

public String getComments()
Get the comments associated with this object

Returns:
String value containing the comments

setComments

public void setComments(String comments)
Set the comments in this object

Parameters:
comments - comments to be set for this object

getName

public abstract String getName()
Get the name. this is the name displayed to the user in the estimate type chooser.

Returns:

getPDF_Test

public AbstractDiscretizedFunc getPDF_Test()
Test function to find the PDF for this estimate. It uses the getProbLessThanEqual() function internally.

Returns:

getCDF_Test

public AbstractDiscretizedFunc getCDF_Test()
Test function to get the CDF for this estimate. It uses the getProbLessThanEqual() function internally.

Returns:

getProbLessThanEqual

public double getProbLessThanEqual(double x)
Get the probability that the true value is less than or equal to the provided x value (the CDF for a probability density funtion)

Parameters:
x -
Returns:

getCDF_TestUsingFractile

public AbstractDiscretizedFunc getCDF_TestUsingFractile()
Test function to get the CDF for this estimate. It uses the getFractile() function internally. It discretizes the Y values and then calls the getFractile() method to get corresponding x values and then plot them.

Returns:

toString

public String toString()
Overrides:
toString in class Object