org.opensha.commons.data.estimate
Class FractileListEstimate

java.lang.Object
  extended by org.opensha.commons.data.estimate.Estimate
      extended by org.opensha.commons.data.estimate.FractileListEstimate

public class FractileListEstimate
extends Estimate

Title: FractileListEstimate.java

Description: This estimate is a list of arbitrary points from a cumulative distribution (CDF). The rules for this etimate are: 1. 1>=y>=0 2. y(i+1)>=y(i) 3. To ensure that median is available: If number of values==1, ensure that y = 0.5 If number of values > 1, first_y<=0.5 and last_y>=0.5

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
Ned Field, Nitin Gupta, Vipin Gupta

Field Summary
static String NAME
           
 
Fields inherited from class org.opensha.commons.data.estimate.Estimate
comments, EST_MSG_FIRST_LAST_PROB_ZERO, EST_MSG_INVLID_RANGE, EST_MSG_MAX_LT_MIN, EST_MSG_NOT_NORMALIZED, EST_MSG_PROB_POSITIVE, EST_MSG_PROBS_NOT_INCREASING, FRACTILE_UNDEFINED, max, MEDIAN_UNDEFINED, min, MSG_ALL_PROB_ZERO, MSG_INVALID_STDDEV, units
 
Constructor Summary
FractileListEstimate(AbstractDiscretizedFunc func)
          Construnctor - Accepts the ArbitrarilyDiscretizedFunc of values and probabilites.
 
Method Summary
 double getFractile(double prob)
          If a point with the associated probability does not exist, the fractal is found by linear interpolation between the two points that bracket the prob.
 double getMedian()
          Returns the X value corresponding to Y = 0.5 If there is no Y where Y =0.5, then linear interpolation is used to find the interpolated X value (this object requires that a median exist).
 String getName()
          Get the name.
 AbstractDiscretizedFunc getValues()
           
 void setValues(AbstractDiscretizedFunc func)
          This checks: 1.
 String toString()
           
 
Methods inherited from class org.opensha.commons.data.estimate.Estimate
getCDF_Test, getCDF_TestUsingFractile, getComments, getMax, getMean, getMin, getMode, getPDF_Test, getProbLessThanEqual, getStdDev, getUnits, isNegativeValuePresent, setComments, setUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

FractileListEstimate

public FractileListEstimate(AbstractDiscretizedFunc func)
Construnctor - Accepts the ArbitrarilyDiscretizedFunc of values and probabilites. The values specified should follow the constraints as specified in the setValues() function.

Parameters:
func - ArbitrarilyDiscretizedFunc function of values and probabilities
Method Detail

toString

public String toString()
Overrides:
toString in class Estimate

setValues

public void setValues(AbstractDiscretizedFunc func)
This checks: 1. y(i+1)>=y(i) 2. All Y >=0 Func is cloned and held internally

Parameters:
func -

getMedian

public double getMedian()
Returns the X value corresponding to Y = 0.5 If there is no Y where Y =0.5, then linear interpolation is used to find the interpolated X value (this object requires that a median exist).

Overrides:
getMedian in class Estimate
Returns:
median value for this set of X and Y values

getFractile

public double getFractile(double prob)
If a point with the associated probability does not exist, the fractal is found by linear interpolation between the two points that bracket the prob. An exeption is thrown if no such points exist.

Overrides:
getFractile in class Estimate
Parameters:
prob -
Returns:

getValues

public AbstractDiscretizedFunc getValues()

getName

public String getName()
Description copied from class: Estimate
Get the name. this is the name displayed to the user in the estimate type chooser.

Specified by:
getName in class Estimate
Returns: