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

    Modifier and Type
    Method
    Description
    Gets a resample from the original sample.
    void
    seed(long... seeds)
    Seed the random number/vector/scenario generator to produce repeatable experiments.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 sample
      resampler - 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 Details

    • seed

      public void seed(long... seeds)
      Description copied from interface: Seedable
      Seed the random number/vector/scenario generator to produce repeatable experiments.
      Specified by:
      seed in interface Seedable
      Parameters:
      seeds - the seeds
    • 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 interface MultivariateResampler
      Returns:
      a resample, e.g., a bootstrap sample