Class StableSampler.BaseStableSampler

    • Constructor Detail

      • BaseStableSampler

        BaseStableSampler​(UniformRandomProvider rng)
        Parameters:
        rng - Underlying source of randomness
    • Method Detail

      • getOmega

        double getOmega()
        Gets a random value for the omega parameter (w). This is an exponential random variable with mean 1.

        Warning: For simplicity this does not check the variate is not 0. The calling CMS algorithm should detect and handle incorrect samples as a result of this unlikely edge case.

        Returns:
        omega
      • getPhi

        double getPhi()
        Gets a random value for the phi parameter. This is a uniform random variable in (-pi/2, pi/2).
        Returns:
        phi
      • getPhiBy2

        double getPhiBy2()
        Gets a random value for the phi parameter divided by 2. This is a uniform random variable in (-pi/4, pi/4).

        Note: Ideally this should not have a value of -pi/4 or pi/4 as the CMS algorithm can generate infinite values when the phi/2 uniform deviate is +/-pi/4. This can result in NaN output. Under certain parameterizations phi/2 close to the limits also create NaN output. Thus output should be checked regardless. Avoiding the extreme values simplifies the number of checks that are required.

        Returns:
        phi / 2