Class AR1CorrelatedRNStream

    • Constructor Detail

      • AR1CorrelatedRNStream

        public AR1CorrelatedRNStream()
      • AR1CorrelatedRNStream

        public AR1CorrelatedRNStream​(double correlation)
        Parameters:
        correlation - the correlation, must be within [-1,1]
      • AR1CorrelatedRNStream

        public AR1CorrelatedRNStream​(double correlation,
                                     RNStreamIfc rng)
        Parameters:
        correlation - the correlation, must be within [-1,1]
        rng - the underlying source of randomness
    • Method Detail

      • randU01

        public double randU01()
        Description copied from interface: RandU01Ifc
        Returns a pseudo-random uniformly distributed number
        Specified by:
        randU01 in interface RandU01Ifc
        Returns:
        the random number
      • randInt

        public final int randInt​(int i,
                                 int j)
        Description copied from interface: RNStreamIfc
        Returns a (pseudo)random number from the discrete uniform distribution over the integers {i, i + 1, . . . , j }, using this stream. Calls randU01 once.
        Specified by:
        randInt in interface RNStreamIfc
        Parameters:
        i - start of range
        j - end of range
        Returns:
        The integer pseudo random number
      • resetStartStream

        public final void resetStartStream()
        Description copied from interface: RNStreamControlIfc
        The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.
        Specified by:
        resetStartStream in interface RNStreamControlIfc
      • setAntitheticOption

        public final void setAntitheticOption​(boolean flag)
        Description copied from interface: RNStreamControlIfc
        Tells the stream to start producing antithetic variates
        Specified by:
        setAntitheticOption in interface RNStreamControlIfc
        Parameters:
        flag - true means that it produces antithetic variates.
      • getLag1Correlation

        public final double getLag1Correlation()
        Returns:
        the lag 1 correlation
      • setLag1Correlation

        public final void setLag1Correlation​(double correlation)
        Parameters:
        correlation - the correlation, must be within [-1,1]
      • getPrevU01

        public final double getPrevU01()
        Description copied from interface: RandU01Ifc
        The previous U(0,1) generated (returned) by randU01()
        Specified by:
        getPrevU01 in interface RandU01Ifc
        Returns:
        previous U(0,1) generated (returned) by randU01()
      • newInstance

        public RNStreamIfc newInstance​(java.lang.String name)
        Description copied from interface: RNStreamNewInstanceIfc
        Returns a copy of the stream that has exactly the same state
        Specified by:
        newInstance in interface RNStreamNewInstanceIfc
        Parameters:
        name - the name of the new instance
        Returns:
        Returns a copy of the stream with exactly the same state
      • newAntitheticInstance

        public RNStreamIfc newAntitheticInstance​(java.lang.String name)
        Specified by:
        newAntitheticInstance in interface GetAntitheticStreamIfc
        Parameters:
        name - the name of the antithetic instance
        Returns:
        a copy of the stream that produces antithetic value