org.opensha.commons.data.function
Class HistogramFunction
java.lang.Object
org.opensha.commons.data.function.AbstractXY_DataSet
org.opensha.commons.data.function.AbstractDiscretizedFunc
org.opensha.commons.data.function.EvenlyDiscretizedFunc
org.opensha.commons.data.function.HistogramFunction
- All Implemented Interfaces:
- Serializable, Iterable<Point2D>, DiscretizedFunc, XY_DataSet, Named, PlotElement, XMLSaveable
public class HistogramFunction
- extends EvenlyDiscretizedFunc
This class sets the tolerance high so that it can be used to construct histograms.
It also provides some methods relevant to a histogram.
- Author:
- field
- See Also:
- Serialized Form
| Methods inherited from class org.opensha.commons.data.function.EvenlyDiscretizedFunc |
add, add, areAllXValuesInteger, clear, deepClone, equalXAndYValues, equalXValues, get, getClosestXIndex, getClosestY, getDelta, getFirstInterpolatedX_inLogXLogYDomain, getFirstInterpolatedX, getIndex, getInterpolatedY_inLogXLogYDomain, getInterpolatedY_inLogYDomain, getInterpolatedY, getMaxX, getMaxY, getMetadataString, getMinX, getMinY, getNum, getPointsIterator, getX, getXIndex, getY, getY, hasPoint, hasPoint, set, set, set, set, set, toString, withinTolerance |
| Methods inherited from class org.opensha.commons.data.function.AbstractDiscretizedFunc |
calcSumOfY_Vals, equals, fromXMLMetadata, getTolerance, loadFuncFromSimpleFile, loadFuncFromSimpleFile, scale, setTolerance, toXMLMetadata, toXMLMetadata, writeSimpleFuncFile, writeSimpleFuncFile |
| Methods inherited from class org.opensha.commons.data.function.AbstractXY_DataSet |
getClosestX, getDatasetsToPlot, getInfo, getName, getPlotNumColorList, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, iterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues |
| Methods inherited from interface org.opensha.commons.data.function.XY_DataSet |
getClosestX, getInfo, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues |
| Methods inherited from interface org.opensha.commons.data.Named |
getName |
HistogramFunction
public HistogramFunction(double min,
int num,
double delta)
- Parameters:
min - num - delta -
HistogramFunction
public HistogramFunction(double min,
double max,
int num)
- Parameters:
min - max - num -
normalizeBySumOfY_Vals
public void normalizeBySumOfY_Vals()
- This normalized the function so that the sum of Y valaues is 1.0
getCumulativeDistFunction
public HistogramFunction getCumulativeDistFunction()
- This returns the cumulative distribution function (total number less than and equal to each x-axis value)
- Returns:
getMode
public double getMode()
- This returns the x-axis value corresponding to the maximum y-axis value
- Returns: