Class GroupResampler
- java.lang.Object
-
- dev.nm.stat.random.sampler.resampler.multivariate.GroupResampler
-
- All Implemented Interfaces:
MultivariateResampler
,Seedable
public class GroupResampler extends Object implements MultivariateResampler
-
-
Constructor Summary
Constructors Constructor Description GroupResampler(Matrix sample)
Constructs a re-sampler that treats each row as a group object, shuffling the groups/rows.GroupResampler(Matrix sample, Resampler resampler)
Constructs a re-sampler that treats each row as a group object, shuffling the groups/rows.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Matrix
newResample()
Gets a resample from the original sample.void
seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
GroupResampler
public GroupResampler(Matrix sample, Resampler resampler)
Constructs a re-sampler that treats each row as a group object, shuffling the groups/rows.- Parameters:
sample
- a multivariate sampleresampler
- a univariate re-sampler to shuffle the row indices, from 1 to sample length
-
GroupResampler
public GroupResampler(Matrix sample)
Constructs a re-sampler that treats each row as a group object, shuffling the groups/rows.- Parameters:
sample
- a multivariate sample
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
newResample
public Matrix newResample()
Description copied from interface:MultivariateResampler
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 interfaceMultivariateResampler
- Returns:
- a resample, e.g., a bootstrap sample
-
-