LogisticDistribution

class LogisticDistribution(val mu: Double = 0.0, val scale: Double = 1.0) : ContinuousDistribution(source)

The logistic distribution, defined by its location mu and scale parameter.

The logistic distribution is a symmetric, bell-shaped continuous distribution similar to the normal distribution but with heavier tails. It is widely used in logistic regression, modeling growth curves, and as the distribution of the log-odds in binary classification. Its CDF is the sigmoid function.

Example:

val dist = LogisticDistribution(mu = 0.0, scale = 1.0)
dist.pdf(0.0) // 0.25 (peak density at the mean)
dist.cdf(0.0) // 0.5
dist.quantile(0.75) // 1.0986... (log-odds)

Constructors

Link copied to clipboard
constructor(mu: Double = 0.0, scale: Double = 1.0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val entropy: Double

The Shannon entropy of this distribution in nats, equal to ln(scale) + 2.

Link copied to clipboard
open override val kurtosis: Double

The excess kurtosis of this distribution, always 6/5 = 1.2.

Link copied to clipboard
open override val mean: Double

The mean of this distribution, equal to mu.

Link copied to clipboard
val mu: Double

the location (center) of the distribution. Defaults to 0.0.

Link copied to clipboard

the scale (spread) of the distribution. Must be positive. Defaults to 1.0.

Link copied to clipboard
open override val skewness: Double

The skewness of this distribution, always zero (symmetric).

Link copied to clipboard
open override val standardDeviation: Double

The standard deviation of this distribution, equal to pi * scale / sqrt(3).

Link copied to clipboard
open override val variance: Double

The variance of this distribution, equal to (pi * scale)^2 / 3.

Functions

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

Returns the cumulative distribution function value at x for this logistic distribution.

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

Returns the natural logarithm of the probability density at x for this logistic distribution.

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

Returns the probability density at x for this logistic distribution.

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

Returns the quantile (inverse CDF) for the given probability p.

Link copied to clipboard
open override fun sample(random: Random): Double

Draws a single random value from this logistic distribution using inverse CDF sampling.

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

Returns the survival function value at x for this logistic distribution.