MVIndependentRV

class MVIndependentRV(theDimension: Int, theRandomVariable: RVariableIfc) : MVRVariable

Represents a multi-variate distribution with the specified dimensions. The sampling of each dimension is independent. That is the resulting distribution has independent marginals that are represented by the same distribution as provided by the supplied random variable

Parameters

theDimension

the dimension, must be at least 2

theRandomVariable

the random variable for the marginals

Constructors

Link copied to clipboard
constructor(theDimension: Int, theRandomVariable: RVariableIfc)

Properties

Link copied to clipboard

If true, the stream will automatically participate in having its stream advanced to the next sub-stream via stream managers

Link copied to clipboard
open override var antithetic: Boolean

Tells the stream to start producing antithetic variates

Link copied to clipboard
open override val dimension: Int

the expected size of the array from sample()

Link copied to clipboard
open override val id: Int
Link copied to clipboard
open override var label: String?
Link copied to clipboard
open override val name: String
Link copied to clipboard

The last (previous) randomly generated value. This value does not change until the next randomly generated value is obtained

Link copied to clipboard
open override var resetStartStreamOption: Boolean

If true, the stream will automatically participate in having its stream reset to its start stream via stream managers

Link copied to clipboard
open override var rnStream: RNStreamIfc

rnStream provides a reference to the underlying stream of random numbers

Link copied to clipboard
open val streamNumber: Int
Link copied to clipboard

The randomly generated values. Each access to value will result in a new sample

Functions

Link copied to clipboard
open override fun advanceToNextSubStream()

Positions the RNG at the beginning of its next substream

Link copied to clipboard
open override fun antitheticInstance(): MVRVariableIfc
Link copied to clipboard
open override fun instance(stream: RNStreamIfc): MVRVariableIfc
Link copied to clipboard

The last (previous) randomly generated value. This value does not change until the next randomly generated value is obtained

Link copied to clipboard
open override fun resetStartStream()

The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.

Link copied to clipboard
open override fun resetStartSubStream()

Resets the position of the RNG at the start of the current substream

Link copied to clipboard
open override fun sample(array: DoubleArray)

Fills the supplied array with a sample of values. This method avoids the creation of a new array. The size of the array must match dimension

open fun sample(): DoubleArray

open fun sample(values: Array<DoubleArray>)

Fills the supplied array of arrays with randomly generated samples

open fun sample(sampleSize: Int): List<DoubleArray>

Generates a list holding the randomly generated arrays of the given dimension. Thus, the elements of the list are the arrays holding the sampled values.

Link copied to clipboard
open fun sampleByColumn(sampleSize: Int): Array<DoubleArray>

Generates a sample by columns of values. The returned array will hold arrays of values, with each element being an array of size sampleSize. That is a 2-D array with nRows = dimension and nColumns = sample size

Link copied to clipboard
open fun useStreamNumber(streamNumber: Int)

Assigns the stream associated with the supplied number from the default RNStreamProvider

Link copied to clipboard

The randomly generated values. Each call to value() will result in a new sample