@AutoService(value=io.virtdata.api.VirtDataFunctionLibrary.class) public class RealDistributions extends Object implements VirtDataFunctionLibrary
This mapper provides inverse cumulative distribution sampling for real-valued distributions. This works by mapping a long value between 0L and Long.MAX_VALUE to a double value in the unit interval [0.0,1.0], and then applying this to an inverse cumulative distribution function that is distribution specific.
Some distributions are realistic in their shape, but not practical in their computational overhead. For these, you can use an interpolated form, in which the function is sampled equidistantly over the unit interval at some resolution, and then all subsequent lookups are computed from simple linear interpolation. This offers the trade-off of a very slight degradation of accuracy (arguably dependent on the actual density curve in question), with the ability to make all statistical sampling perform in O(1) time, and possibly more importantly, the same time as all other statistical curves.
There are various ways to configure these distributions. For each, there are two choices to be made: mapping vs hashing, and computing vs interpolating.
Mapping vs Hashing
Computing vs Interpolating
It is valid to include mapto_ or hashto_ and interpolate_ or compute_ in your specifiers any order, so long as there are no conflicts.
Examples:
| Constructor and Description |
|---|
RealDistributions() |
| Modifier and Type | Method and Description |
|---|---|
static LongToDoubleFunction |
forSpec(String spec) |
List<String> |
getDataMapperNames() |
String |
getName() |
List<ResolvedFunction> |
resolveFunctions(Class<?> outputClass,
Class<?> inputClass,
String functionName,
Object... parameters) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDataMapper, getDataMappers, resolveFunctionspublic static LongToDoubleFunction forSpec(String spec)
public List<ResolvedFunction> resolveFunctions(Class<?> outputClass, Class<?> inputClass, String functionName, Object... parameters)
resolveFunctions in interface VirtDataFunctionLibrarypublic List<String> getDataMapperNames()
getDataMapperNames in interface VirtDataFunctionLibraryCopyright © 2018. All rights reserved.