BootstrapSampler

open class BootstrapSampler(originalData: DoubleArray, val estimator: MVBSEstimatorIfc, streamNumber: Int = 0, val streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider) : RNStreamControlIfc, StreamNumberIfc(source)

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, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider)

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

Holds the estimated values (for each dimension) from the bootstrap samples. When the MVEstimator is applied to each bootstrap sample, it results in an array of estimates from the sample. This list holds those arrays. It is cleared whenever new samples are generated and then filled during the bootstrapping process.

Link copied to clipboard
protected val myOriginalPop: DPopulation
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 val streamNumber: Int
Link copied to clipboard

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
protected fun innerBoot(estimate: DoubleArray, bSample: DoubleArray)

Can be used by subclasses to implement logic that occurs within the boot sampling loop. The function is executed at the end of the main boot sampling loop. The parameter, estimate is the estimated quantities from the current bootstrap sample, bSample. For example, this function could be used to bootstrap on the bootstrap sample.

Link copied to clipboard

The returned list contains the bootstrap estimates for each of the dimensions. From these elements the bootstrap confidence intervals and other statistical analysis can be performed.

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