MixtureRV

class MixtureRV @JvmOverloads constructor(list: List<RVariableIfc>, cdf: DoubleArray, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : RVariable(source)

A mixture of random variables: each value is a value of one of them, selected with the probabilities given by the cdf. The mixture samples its own copies of the supplied variables, which draw from its one stream, in turn with the selection; the supplied variables themselves are not used, and each must be able to draw from a stream it is given (see canShareStream).

Parameters

list

a list holding the random variables to select from

cdf

the cumulative probability associated with each element of the list

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(list: List<RVariableIfc>, cdf: DoubleArray, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Properties

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 = 0, rnStreamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider): MixtureRV