Class Exp

All Implemented Interfaces:
Serializable, Copyable

public class Exp extends Markovian implements Serializable
An exponential distribution.
See Also:
  • Constructor Details

    • Exp

      public Exp(double lambda)
      Creates an exponential distribution with the specified rate parameter.
      Parameters:
      lambda - the rate parameter (must be positive)
  • Method Details

    • fitMean

      public static Exp fitMean(double MEAN)
      Creates an exponential distribution fitted to the specified mean.
      Parameters:
      MEAN - the desired mean value
      Returns:
      an exponential distribution with the specified mean
    • fitRate

      public static Exp fitRate(double RATE)
      Creates an exponential distribution fitted to the specified rate.
      Parameters:
      RATE - the desired rate value
      Returns:
      an exponential distribution with the specified rate
    • evalCDF

      public double evalCDF(double t)
      Evaluates the cumulative distribution function at the given point.
      Overrides:
      evalCDF in class Markovian
      Parameters:
      t - the point at which to evaluate the CDF
      Returns:
      the CDF value F(t) = 1 - e^(-λt)
    • evalLST

      public double evalLST(double s)
      Evaluates the Laplace-Stieltjes transform at the given point.
      Overrides:
      evalLST in class Markovian
      Parameters:
      s - the transform variable
      Returns:
      the LST value λ/(λ+s)
    • setMean

      public void setMean(double newMean)
      Sets the mean by rescaling the process AND the rate parameter. Markovian.setMean rewrites the MAP representation only, but getRate, getMean, evalCDF, evalLST and Network.refreshStruct all read the rate parameter, so a rescaled Exp would otherwise keep reporting its old rate and every estimator's model update would be silently lost.
      Overrides:
      setMean in class Markovian
      Parameters:
      newMean - the new mean value
    • getMean

      public double getMean()
      Gets the mean of this exponential distribution.
      Overrides:
      getMean in class Markovian
      Returns:
      the mean value (1/λ)
    • getNumberOfPhases

      public long getNumberOfPhases()
      Gets the number of phases in this distribution. Exponential distribution has a single phase.
      Overrides:
      getNumberOfPhases in class Markovian
      Returns:
      always returns 1
    • getRate

      public double getRate()
      Gets the rate parameter of this exponential distribution.
      Overrides:
      getRate in class Markovian
      Returns:
      the rate parameter λ
    • getSCV

      public double getSCV()
      Gets the squared coefficient of variation. For exponential distribution, SCV = 1.
      Overrides:
      getSCV in class Markovian
      Returns:
      always returns 1
    • getSkewness

      public double getSkewness()
      Gets the skewness of this exponential distribution.
      Overrides:
      getSkewness in class Markovian
      Returns:
      always returns 2
    • getVar

      public double getVar()
      Gets the variance of this exponential distribution.
      Overrides:
      getVar in class Markovian
      Returns:
      the variance (1/λ²)
    • sample

      public double[] sample(int n)
      Description copied from class: Distribution
      Generates random samples from this distribution using default random generator.
      Overrides:
      sample in class Markovian
      Parameters:
      n - the number of samples to generate
      Returns:
      array of random samples
    • sample

      public double[] sample(int n, Random rand)
      Description copied from class: Distribution
      Generates random samples from this distribution using the specified random generator.
      Overrides:
      sample in class Markovian
      Parameters:
      n - the number of samples to generate
      rand - the random number generator to use
      Returns:
      array of random samples
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • updateRate

      public void updateRate(double rate)
      Updates the rate parameter of this exponential distribution.
      Parameters:
      rate - the new rate parameter
    • numberOfPhases

      public long numberOfPhases()
      Property alias for getNumberOfPhases
      Overrides:
      numberOfPhases in class Markovian
    • numPhases

      public long numPhases()
      Property alias for getNumberOfPhases
      Overrides:
      numPhases in class Markovian
    • mean

      public double mean()
      Property alias for getMean
      Overrides:
      mean in class Markovian
    • rate

      public double rate()
      Property alias for getRate
      Overrides:
      rate in class Markovian
    • scv

      public double scv()
      Property alias for getSCV
      Overrides:
      scv in class Markovian
    • skewness

      public double skewness()
      Property alias for getSkewness
      Overrides:
      skewness in class Markovian
    • var

      public double var()
      Property alias for getVar
      Overrides:
      var in class Markovian