Class CaseResamplingReplacement
java.lang.Object
dev.nm.stat.random.sampler.resampler.bootstrap.CaseResamplingReplacement
This is the classical bootstrap method described in the reference. It draws
from the original sample with replacement.
This implementation is thread-safe that allows concurrent access to
newResample()
by multiple threads.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCaseResamplingReplacement
(double[] sample) Constructs a bootstrap sample generator.CaseResamplingReplacement
(double[] sample, ConcurrentCachedRLG rlg) Constructs a bootstrap sample generator.CaseResamplingReplacement
(double[] sample, RandomLongGenerator uniform) Constructs a bootstrap sample generator. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Gets a resample from the original sample.void
seed
(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments.
-
Constructor Details
-
CaseResamplingReplacement
public CaseResamplingReplacement(double[] sample) Constructs a bootstrap sample generator. This is the classical bootstrap with replacement.- Parameters:
sample
- the original sample.
-
CaseResamplingReplacement
Constructs a bootstrap sample generator. This is the classical bootstrap with replacement.- Parameters:
sample
- the original sample.uniform
- a uniform random long generator
-
CaseResamplingReplacement
Constructs a bootstrap sample generator. This is the classical bootstrap with replacement.- Parameters:
sample
- the original sample.rlg
- a concurrent uniform random long generator
-
-
Method Details
-
seed
public void seed(long... seeds) Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments. -
newResample
public double[] newResample()Description copied from interface:Resampler
Gets a resample from the original sample. It is very important this method is thread-safe so resampling can be run in parallel.- Specified by:
newResample
in interfaceResampler
- Returns:
- a resample, e.g., a bootstrap sample
-