class Statistics::Distributions::Constant

Overview

Represents a deterministic distribution taking a single value.

Defined in:

lib/distributions.cr

Constructors

Instance Method Summary

Instance methods inherited from class Statistics::Distributions::DiscreteDistribution(Float64)

pmf(x) pmf

Instance methods inherited from class Statistics::Distributions::Distribution(Float64)

rand : T rand

Constructor Detail

def self.new(k rand : Float64) #

Creates a degenerate distribution which only takes the value k.


Instance Method Detail

def pmf(x) #

The Probability Mass Function (PMF) of a discrete random variable.


def rand : Float64 #
Description copied from class Statistics::Distributions::Distribution(Float64)

Samples a random variable with the given distribution.