DEmpiricalRV

class DEmpiricalRV @JvmOverloads constructor(values: DoubleArray, cdf: DoubleArray, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : ParameterizedRV(source)

Discrete Empirical Random Variable. Randomly selects from the supplied values in the value array according to the supplied CDF array. The CDF array must have valid probability elements and last element equal to 1. Every element must be greater than or equal to the previous element in the CDF array. That is, monotonically increasing.

Parameters

values

array to select from

cdf

the cumulative probability associated with each element of array

streamNum

the random number stream number, defaults to 0, which means the next stream

streamProvider

the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider

name

an optional name

Constructors

Link copied to clipboard
constructor(probData: List<ProbPoint>, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Secondary constructor for the DEmpiricalRV class. This constructor initializes the object using a list of ProbPoint instances, representing the possible values and their associated probabilities, as well as their cumulative probabilities.

constructor(histogram: HistogramIfc, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Secondary constructor for the DEmpiricalRV class, allowing initialization using a histogram and optional parameters.

constructor(values: DoubleArray, cdf: DoubleArray, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Properties

Link copied to clipboard

Provides a copy of the cumulative distribution function (CDF) array associated with the discrete empirical random variable. The CDF represents the cumulative probabilities corresponding to the defined probability points and values of the random variable.

Link copied to clipboard
open override val parameters: RVParameters
Link copied to clipboard

Represents a list of ProbPoint objects that encapsulates the value, probability, and cumulative probability information for a discrete empirical random variable.

Link copied to clipboard

Retrieves a copy of the internal array of values associated with the empirical random variable.

Functions

Link copied to clipboard
open override fun instance(streamNum: Int, rnStreamProvider: RNStreamProviderIfc): DEmpiricalRV
Link copied to clipboard
open override fun toString(): String