BinomialDistribution

Represents the bernoulli distribution.

Since

1.0.0

Author

Matthias Kovacic

Parameters

n

The number of trials.

p

The probability of success.

See also

Throws

If p is not between 0 and 1.

Constructors

Link copied to clipboard
constructor(n: Int, p: Double)

Creates a new binomial 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 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(): SingleRange

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 binomially distributed.

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

Returns n samples that are normally 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.