public class NormalDistStats extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
double |
max |
double |
mean |
double |
min |
double |
stddev |
Constructor and Description |
---|
NormalDistStats(double mean,
double stddev,
double min,
double max)
A Constructor for the pre computed stats.
|
NormalDistStats(List<Double> values)
Create an instance of this from a list of values.
|
Modifier and Type | Method and Description |
---|---|
static NormalDistStats |
fromConf(Map<String,Object> conf)
Read the stats from a config.
|
static NormalDistStats |
fromConf(Map<String,Object> conf,
Double def)
Read the stats from a config.
|
double |
nextRandom(Random rand)
Generate a random number that follows the statistical distribution.
|
NormalDistStats |
scaleBy(double v)
Scale the stats by v.
|
Map<String,Object> |
toConf()
Return this as a config.
|
String |
toString() |
public final double mean
public final double stddev
public final double min
public final double max
public NormalDistStats(List<Double> values)
values
- the values to compute metrics from.public NormalDistStats(double mean, double stddev, double min, double max)
mean
- the mean of the values.stddev
- the standard deviation of the values.min
- the min of the values.max
- the max of the values.public static NormalDistStats fromConf(Map<String,Object> conf)
conf
- the config.public static NormalDistStats fromConf(Map<String,Object> conf, Double def)
conf
- the config.def
- the default mean.public Map<String,Object> toConf()
public double nextRandom(Random rand)
rand
- the random number generator to usepublic NormalDistStats scaleBy(double v)
v
- the amount to scale by 1.0 is nothing 0.5 is half.Copyright © 2023 The Apache Software Foundation. All rights reserved.