PWCEmpiricalRV

class PWCEmpiricalRV @JvmOverloads constructor(breakPoints: DoubleArray, proportions: DoubleArray = DoubleArray(breakPoints.size - 1) { 1.0 / (breakPoints.size - 1) }, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : ParameterizedRV(source)

Represents a piece-wise continuous empirical random variable specified via intervals defined by breakpoints and probabilities associated with each interval. A piecewise linear approximation forms the basis for the CDF where the breakpoints form the linear segments. There must be at least 1 interval (and two breakpoints).

Parameters

breakPoints

The break points defining the intervals such that ``p[j]`` is associated with breakpoints ``b[j] and b[j+1] for j = 0, 1,..., n-1``, where n is the number of break points. The number of breakpoints should be 1 more than the number of proportions. The breakpoints must be strictly increasing and finite. @param proportions A double array holding the proportion associated with the intervals defined by the breakpoints. All proportions must be strictly greater than 0 and strictly less than 1. If not supplied, the default is intervals with equal probability. That is, with a proportion equal to (1.0/(n - 1.0)). @param streamNum the random number stream number, defaults to 0, which means the next stream @param streamProvider the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider @param name an optional name

Constructors

Link copied to clipboard
constructor(breakPoints: DoubleArray, proportions: DoubleArray = DoubleArray(breakPoints.size - 1) { 1.0 / (breakPoints.size - 1) }, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)
constructor(histogram: HistogramIfc, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Note the requirements for breakpoints and proportions.

Properties

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

Functions

Link copied to clipboard
protected open override fun generate(): Double
Link copied to clipboard
open override fun instance(streamNum: Int, rnStreamProvider: RNStreamProviderIfc): PWCEmpiricalRV
Link copied to clipboard
open override fun toString(): String