Package jline.api.mam

Class Me_sampleKt

  • All Implemented Interfaces:

    
    public final class Me_sampleKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static DoubleArray me_sample(Matrix alpha, Matrix A, Long n, Random random) Generates random samples from a Matrix Exponential (ME) distribution using inverse CDF interpolation.
      final static DoubleArray me_sample(MatrixCell ME, Long n, Random random) Generates random samples from an ME distribution using matrices stored in a MatrixCell.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • me_sample

         final static DoubleArray me_sample(Matrix alpha, Matrix A, Long n, Random random)

        Generates random samples from a Matrix Exponential (ME) distribution using inverse CDF interpolation.

        Algorithm:

        • Precompute a dense grid of CDF values from 0 to mean + 10*sigma

        • For each sample, generate u ~ Uniform(0,1)

        • Find the corresponding time value by: a. Binary search in the CDF grid to locate u b. Linear interpolation between adjacent grid points

        Parameters:
        alpha - The initial vector of the ME distribution
        A - The matrix parameter of the ME distribution
        n - The number of samples to generate
        random - The random number generator to use
        Returns:

        Array of n samples from the ME distribution

      • me_sample

         final static DoubleArray me_sample(MatrixCell ME, Long n, Random random)

        Generates random samples from an ME distribution using matrices stored in a MatrixCell.

        Note: For ME distributions stored in MatrixCell format {D0=A, D1=-Aealpha'}, we need to reconstruct alpha. However, for sampling purposes, it's better to use the explicit (alpha, A) overload.

        Parameters:
        ME - The Matrix Exponential distribution stored in a MatrixCell
        n - The number of samples to generate
        random - The random number generator to use
        Returns:

        Array of n samples from the ME distribution