Class InverseTransformParetoSampler

    • Field Detail

      • scale

        private final double scale
        Scale.
      • oneOverShape

        private final double oneOverShape
        1 / Shape.
      • nextDouble

        private final java.util.function.LongToDoubleFunction nextDouble
        Method to generate the (1 - p) value.
    • Constructor Detail

      • InverseTransformParetoSampler

        public InverseTransformParetoSampler​(UniformRandomProvider rng,
                                             double scale,
                                             double shape)
        Create an instance.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        scale - Scale of the distribution.
        shape - Shape of the distribution.
        Throws:
        java.lang.IllegalArgumentException - if scale <= 0 or shape <= 0
      • InverseTransformParetoSampler

        private InverseTransformParetoSampler​(double scale,
                                              double shape,
                                              UniformRandomProvider rng)
        Parameters:
        scale - Scale of the distribution.
        shape - Shape of the distribution.
        rng - Generator of uniformly distributed random numbers.
    • Method Detail

      • sample

        public double sample()
        Creates a double sample.
        Specified by:
        sample in interface ContinuousSampler
        Returns:
        a sample.
      • of

        public static SharedStateContinuousSampler of​(UniformRandomProvider rng,
                                                      double scale,
                                                      double shape)
        Creates a new Pareto distribution sampler.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        scale - Scale of the distribution.
        shape - Shape of the distribution.
        Returns:
        the sampler
        Throws:
        java.lang.IllegalArgumentException - if scale <= 0 or shape <= 0
        Since:
        1.3