MVSampleIfc

interface MVSampleIfc

An interface for getting multi-variable samples, each sample has many values held in an array. Clients need to implement the sample(array) function in order to fill up the array with the sample values. The array of size dimension represent 1 sample with elements as the sample values for each coordinate of the dimension. For example, for 2-D, sample returns an array {x0, x1} where x0 is the sample for the first coordinate and x1 is the sample value for the second coordinate.

Inheritors

Properties

Link copied to clipboard
abstract val dimension: Int

the expected size of the array from sample()

Functions

Link copied to clipboard
open fun sample(): DoubleArray

open fun sample(values: Array<DoubleArray>)

Fills the supplied array of arrays with randomly generated samples

abstract 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(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