Package com.bayesserver.analysis
Class HistogramDensity
- java.lang.Object
-
- com.bayesserver.analysis.HistogramDensity
-
- All Implemented Interfaces:
EmpiricalDensity
public final class HistogramDensity extends Object implements EmpiricalDensity
Represents an empirical density function built from a histogram, which can represent arbitrary univariate distributions.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecdf(double x)Calculates an approximate value for cdf(x).doubleinverseCdf(double probability)Calculates an approximate value for the inverse cumulative distribution function.static HistogramDensitylearn(Iterable<WeightedValue> values, HistogramDensityOptions options)Learns a univariate empirical density from data.
-
-
-
Method Detail
-
inverseCdf
public double inverseCdf(double probability)
Calculates an approximate value for the inverse cumulative distribution function.- Specified by:
inverseCdfin interfaceEmpiricalDensity- Parameters:
probability- The probability p at which to return x when p = Cdf(x) .- Returns:
- The approximate inverse cdf.
-
cdf
public double cdf(double x)
Calculates an approximate value for cdf(x).- Specified by:
cdfin interfaceEmpiricalDensity- Parameters:
x- The value at which to evaluate the cdf.- Returns:
- The approximate cdf(x).
-
learn
public static HistogramDensity learn(Iterable<WeightedValue> values, HistogramDensityOptions options)
Learns a univariate empirical density from data.- Parameters:
values- The values to learn from.options- Options affecting the learning process.- Returns:
- An empirical density.
-
-