Class TruncatedWrapper

    • Field Detail

      • sampler

        protected SliceSampler sampler
        sampler to sample from constrained distribution directly
    • Method Detail

      • reseedRandomGenerator

        public void reseedRandomGenerator​(long seed)
        Specified by:
        reseedRandomGenerator in interface org.apache.commons.math3.distribution.RealDistribution
        Overrides:
        reseedRandomGenerator in class RejectionWrapper
      • sample

        public double sample()
        Slice sampling Note that due to floating point arithmetic, too large constraints, i.e. those where the density of the truncated distribution is 0, will not work!
        Specified by:
        sample in interface org.apache.commons.math3.distribution.RealDistribution
        Overrides:
        sample in class RejectionWrapper
        Throws:
        java.lang.IllegalArgumentException - when constraint is too high, i.e., density is (floating point rounded) zero.
      • sample

        public double[] sample​(int sampleSize)
        Specified by:
        sample in interface org.apache.commons.math3.distribution.RealDistribution
        Overrides:
        sample in class RejectionWrapper