ContinuousDistribution

public protocol ContinuousDistribution

Protocol for continuous distributions.

Defines the quantile() method that must be implemented.

  • Undocumented

    Declaration

    Swift

    func quantile(_ p: Double) -> Double
  • random(using:) Extension method

    Single discrete random value using a user-provided random number generator

    Declaration

    Swift

    public func random<T>(using generator: inout T) -> Double where T : RandomNumberGenerator

    Parameters

    using

    A random number generator

    Return Value

    A random number from the distribution represented by the instance

  • random() Extension method

    Single discrete random value using the system random number generator

    Declaration

    Swift

    public func random() -> Double

    Return Value

    A random number from the distribution represented by the instance

  • random(_:) Extension method

    Array of discrete random values

    Complexity

    O(n)

    Declaration

    Swift

    public func random(_ n: Int) -> [Double]

    Parameters

    n

    number of values to produce