Class IntEmpirical

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class IntEmpirical
    extends IntSequence
    Returns an integer in the range [0,n]. The probability of each value is determined by the probabilities passed to setProbabilities(double[]) , and can be arbitrary positive numbers as long as they sum up to 1.0.
    Author:
    Torsten Hildebrandt
    See Also:
    Serialized Form
    • Constructor Detail

      • IntEmpirical

        public IntEmpirical()
      • IntEmpirical

        public IntEmpirical​(double[] probs)
      • IntEmpirical

        public IntEmpirical​(Random rnd,
                            double[] probs)
      • IntEmpirical

        public IntEmpirical​(String name,
                            double[] probs)
      • IntEmpirical

        public IntEmpirical​(double[] probs,
                            int[] values)
      • IntEmpirical

        public IntEmpirical​(Random rnd,
                            double[] probs,
                            int[] values)
      • IntEmpirical

        public IntEmpirical​(String name,
                            double[] probs,
                            int[] values)
      • IntEmpirical

        public IntEmpirical​(Random rnd,
                            String name,
                            double[] probs,
                            int[] values)
    • Method Detail

      • getProbabilities

        public double[] getProbabilities()
      • setProbabilities

        public void setProbabilities​(double[] probs)
      • getValues

        public int[] getValues()
      • setValues

        public void setValues​(int[] vs)
      • setProbabilities

        public void setProbabilities​(double[] probs,
                                     int[] values)
      • getValueRange

        public Pair<Double,​Double> getValueRange()
        Description copied from class: DblSequence
        This method computes the minimum and maximum support values (range of possible values) of this stream.
        Overrides:
        getValueRange in class DblSequence
        Returns:
        A Pair containing the minimum and maximum support values.