UniformDistribution

Represents the uniform distribution.

Since

1.0.0

Author

Matthias Kovacic

Parameters

min

The minimum value of the distribution.

max

The maximum value of the distribution.

seed

The seed to use for the random number generator.

See also

Throws

If min is greater than max.

Constructors

Link copied to clipboard
constructor(min: Double, max: Double, seed: Int = 0)

Creates a new uniform distribution.

Functions

Link copied to clipboard
open override fun cdf(x: Double): SingleRange

Returns the cumulative distribution function (CDF) of the distribution.

Link copied to clipboard
open override fun entropy(type: Distribution.EntropyType): Double

Returns the entropy of the distribution.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun fisherInformation(n: Int): DoubleArray

Returns the Fisher information of the distribution.

Link copied to clipboard
fun getSeed(): Int

Returns the seed used to generate the distribution.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Returns true if the distribution is continuous.

Link copied to clipboard

Returns true if the distribution is discrete.

Link copied to clipboard
open override fun klDivergence(other: ContinuousDistribution): Double

Calculates the Kullback-Leibler divergence between this distribution and the other one.

Link copied to clipboard
open override fun kurtosis(): Double

Returns the kurtosis of the distribution.

Link copied to clipboard
open override fun mad(): Double

Returns the mean absolute deviation (MAD) of the distribution.

Link copied to clipboard
open override fun mean(): Double

Returns the mean of the distribution.

Link copied to clipboard
open override fun median(): SingleRange

Returns the median of the distribution.

Link copied to clipboard
open override fun mgf(): (Int) -> Double

Returns the moment generating function (MGF) of the distribution.

Link copied to clipboard
open override fun mode(): ContinuousRange

Returns the mode of the distribution.

Link copied to clipboard
open override fun moment(n: Int): Double

Returns the n-th moment of the distribution.

Link copied to clipboard
open override fun pdf(x: Double): SingleRange

Returns the probability density function (PDF) of the distribution.

Link copied to clipboard
open override fun quantile(x: Double): SingleRange

Returns the quantile of the distribution.

Link copied to clipboard
open override fun sample(vararg support: Double): Double

Returns a sample that is uniformly distributed.

open override fun sample(n: Int, vararg support: Double): DoubleArray

Returns n samples that are uniformly distributed.

Link copied to clipboard
open override fun skewness(): Double

Returns the skewness of the distribution.

Link copied to clipboard
open override fun stddev(): Double

Returns the standard deviation of the distribution.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun variance(): Double

Returns the variance of the distribution.