Class Erlang

All Implemented Interfaces:
Serializable, Copyable

public class Erlang extends Markovian implements Serializable
An Erlang-n distribution with n phases.
See Also:
  • Constructor Details

    • Erlang

      public Erlang(double phaseRate, int n)
      Creates an Erlang distribution with the specified phase rate and number of phases.
      Parameters:
      phaseRate - the rate parameter for each phase
      n - the number of phases
  • Method Details

    • fitMeanAndOrder

      public static Erlang fitMeanAndOrder(double mean, long numPhases)
      Creates an Erlang distribution fitted to the specified mean and number of phases.
      Parameters:
      mean - the desired mean value
      numPhases - the number of phases
      Returns:
      an Erlang distribution with the specified characteristics
    • fitMeanAndSCV

      public static Erlang fitMeanAndSCV(double mean, double SCV)
      Creates an Erlang distribution fitted to the specified mean and squared coefficient of variation.
      Parameters:
      mean - the desired mean value
      SCV - the desired squared coefficient of variation
      Returns:
      an Erlang distribution with the specified characteristics
    • fitMeanAndStdDev

      public static Erlang fitMeanAndStdDev(double mean, double stdDev)
      Creates an Erlang distribution fitted to the specified mean and standard deviation.
      Parameters:
      mean - the desired mean value
      stdDev - the desired standard deviation
      Returns:
      an Erlang distribution with the specified characteristics
    • 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 at point 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))^r
    • getMean

      public double getMean()
      Gets the mean of this Erlang distribution.
      Overrides:
      getMean in class Markovian
      Returns:
      the mean value (r/α)
    • getRate

      public double getRate()
      Gets the rate of this Erlang distribution.
      Overrides:
      getRate in class Markovian
      Returns:
      the rate (α/r)
    • getSCV

      public double getSCV()
      Gets the squared coefficient of variation.
      Overrides:
      getSCV in class Markovian
      Returns:
      the SCV (1/r)
    • getSkewness

      public double getSkewness()
      Gets the skewness of this Erlang distribution.
      Overrides:
      getSkewness in class Markovian
      Returns:
      the skewness (2/√r)
    • getVar

      public double getVar()
      Gets the variance of this Erlang distribution.
      Overrides:
      getVar in class Markovian
      Returns:
      the variance (r/α²)
    • sample

      public double[] sample(int n, Random random)
      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
      random - the random number generator to use
      Returns:
      array of random samples
    • 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
    • mean

      public double mean()
      Kotlin-style property alias for getMean()
      Overrides:
      mean in class Markovian
    • rate

      public double rate()
      Kotlin-style property alias for getRate()
      Overrides:
      rate in class Markovian
    • scv

      public double scv()
      Kotlin-style property alias for getSCV()
      Overrides:
      scv in class Markovian
    • skewness

      public double skewness()
      Kotlin-style property alias for getSkewness()
      Overrides:
      skewness in class Markovian
    • var

      public double var()
      Kotlin-style property alias for getVar()
      Overrides:
      var in class Markovian