BootstrapSampler

open class BootstrapSampler(originalData: DoubleArray, val estimator: MVBSEstimatorIfc, stream: RNStreamIfc = KSLRandom.nextRNStream()) : RNStreamControlIfc, RNStreamChangeIfc

This class facilitates bootstrap sampling. The originalData is sampled from, with replacement, repeatedly to form bootstrap samples from which bootstrap statistics are computed. The estimator provides the mechanism for estimating statistical quantities from the original data. From the data, it can produce 1 or more estimated quantities. Bootstrap estimates are computed on the observed estimates from each bootstrap sample. The specified stream controls the bootstrap sampling process.

Constructors

Link copied to clipboard
constructor(originalData: DoubleArray, estimator: MVBSEstimatorIfc, stream: RNStreamIfc = KSLRandom.nextRNStream())

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

Returns an 2-D array representation of the estimates from the bootstrapping process. The rows of the array are the multi-variate estimates from each bootstrap sample. The columns of the array represent the bootstrap estimates for each dimension across all the bootstrap samples.

Link copied to clipboard

If the bootstrap samples were saved, this returns the generated averages for each of the samples

Link copied to clipboard

If the bootstrap samples were saved, this returns the generated variance for each of the samples

Link copied to clipboard

If the save bootstrap data option was not turned on during the sampling then the list returned is empty.

Link copied to clipboard

Statistics collected across each dimension based on the estimates computed from each bootstrap sample. These statistics are cleared whenever generateSamples() is invoked in order to report statistics on the newly generated bootstrap samples.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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

the underlying stream of random numbers

Link copied to clipboard
open val streamNumber: Int

Functions

Link copied to clipboard
open override fun advanceToNextSubStream()

Positions the RNG at the beginning of its next sub-stream

Link copied to clipboard
fun bootStrapEstimates(numBootstrapSamples: Int, saveBootstrapSamples: Boolean = false): List<BootstrapEstimate>

This method changes the underlying state of the Bootstrap instance by performing the bootstrap sampling.

Link copied to clipboard
Link copied to clipboard

Creates a random variable to represent the data in each bootstrap sample for which the data was saved.

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 sub-stream

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

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